> On Jan 30, 2015, at 12:43 PM, Paulo Antonio McNally Zambrana 
> <[email protected]> wrote:
> 
> How to get req.app.kraken.get('api_url'); from a model with krakenJS?
> 
> req its from a route, but i a need set api_url into a model.

Good question! Kraken's configurations are pretty isolated -- usually, having 
to do this is a smell that things aren't as separate as they should be 
(presentation layer things mixed with business logic), but sometimes that's how 
it works out.

You can attach an onconfig handler to kraken in index.js, which, when called, 
can inject the configuration into the model. Just be aware that it's 
asynchronous, so don't rely on it until onconfig has fired, or the app emits 
the start event.

Aria

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/DEC5B15F-323A-4E0E-9265-309AED9434B9%40nbtsc.org.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to