feathersjs-ecosystem / configuration

[MOVED] A plugin for configuring a Feathers application
https://github.com/feathersjs/feathers
MIT License
28 stars 15 forks source link

Getting Env name #41

Closed josx closed 7 years ago

josx commented 7 years ago

I think it is usefull to know which enviroment is loaded. Example for doing something in default or development mode. (not using directly env vars in node). @daffl what do you think about?

eddyystop commented 7 years ago

What are you needing that process.env.NODE_ENV doe not provide?

josx commented 7 years ago

Yes, I know that is what i want. But i think it is usefull to have it the configuration module, so we can do app.get('env') or something like that.

eddyystop commented 7 years ago

I'm not sure I get the advantage of app.get('env') over the obvious process.env.NODE_ENV.

marshallswain commented 7 years ago

You can actually achieve this with the current module. In your config, do this:

{
  "env": "NODE_ENV"
}

That should do the trick. It will read the NODE_ENV environment variable and make it available at app.get('env')

josx commented 7 years ago

Ok, will do it this way.