, production . , , , , , , 1 .
, . / , , , . , , , (NCONF, ).
, config.js, :
var nconf = require('nconf');
nconf.env().argv();
nconf.defaults({
'http': {'port': 3000},
'mode': 'devel'
});
module.exports = nconf;
app.js , :
var nconf = require('./config.js');
http.createServer(app).listen(nconf.get('http:port'),
function(){console.log('Server listening on port ' + nconf.get('http:port')}
);
, app.set app.get, , . , : - , .
, , . . , :
nconf.env().file({file: 'appconfig.json'}).argv();
.
source
share