> On May 31, 2016, at 10:41, Emerson Luiz <[email protected]> wrote:
>
> Aria,
>
> Thanks for your response...
>
> I use MongooseJS, i think his no have method GET.
>
> I need take this variable for all modules in my app.
with mongoose, you'd use `yourModel.find`, since it's an object mapper, not
just a plain mongo client. It's got schemas and such that you'd want to use.
It may be useful to you to use some simple injection in your app: instead of
modules like so:
module.exports = function thing() {
global.config // used here
}
you may want to do this:
module.exports = function mymodule(config) {
return function thing() {
config // used here
}
}
So your configuration bit can load the rest of your app. Maybe not, but global
variables are a smell and it's worth thinking about the order things load in
and how easy it is to mess that up.
--
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/0878330F-3F86-4E9F-89C0-AB3D3E3D29F1%40dinhe.net.
For more options, visit https://groups.google.com/d/optout.