Created
July 10, 2013 22:53
-
-
Save gregberge/5970919 to your computer and use it in GitHub Desktop.
Simple configuration module using nconf.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nconf = require('nconf'); | |
module.exports = nconf | |
.env() | |
.file(__dirname + '/config.json') | |
.file('env', __dirname + '/config.' + nconf.get('NODE_ENV') + '.json') | |
.file('user', __dirname + '/config.' + nconf.get('NODE_ENV') + '.' + nconf.get('USER') + '.json'); |
Nope, in fact it doesn't work, it was working only because of the name "env", we have to dig deeper…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Beware line 6: naming it "env" overrides previous ".env()" and last one will try to load "config.undefined.undefined.json" ;)