Skip to content

Commit

Permalink
Merge pull request #161 from cloudron-io/nconf_defaults
Browse files Browse the repository at this point in the history
nconf: use nconf.defaults to set default values
  • Loading branch information
aliasaria authored Jun 8, 2023
2 parents c909752 + 05c3920 commit ec468ae
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ nconf.argv()
.file({ file: 'config.json' });

// Now set default config values:
nconf.set('server:baseurl', '/');
nconf.set('server:port', 8080);

nconf.set('ga:account', 'UA-2069672-4');

nconf.set('redis:url', 'redis://127.0.0.1:6379');
nconf.set('redis:prefix', '#scrumblr#');
nconf.defaults({
server: {
baseurl: '/',
port: 8080
},
ga: {
account: 'UA-2069672-4'
},
redis: {
url: 'redis://127.0.0.1:6379',
prefix: '#scrumblr#'
}
});

console.log('NODE_ENV: ' + nconf.get('NODE_ENV'));
console.log('server: ' + JSON.stringify(nconf.get('server')));
Expand Down

0 comments on commit ec468ae

Please sign in to comment.