Few Ways to Handler Environment Config at Express.js
2014/8/11 min read
bookmark this
nconfig is very powerful configuration module in node.js, it is key value store, plugablle, able to use with redis
Usage:
When you use it, you can create following different kind of enviroment variable.
One if the config file, development.json might looks like following.
2. Write your own config
Instead of using nconfig, you can use following javascript to write your own.
inside the config.js, use lodash to merge default config and enviroment specific config value.
You can use set NODE_ENV=development to change node.js enviroment variable for your application.