How to use the defaults function from nconf
Find comprehensive JavaScript nconf.defaults code examples handpicked from public code repositorys.
39 40 41 42 43 44 45 46 47 48
file = name; } return module.exports.use(name, { type: 'file', file }); }, defaults: d => { nconf.defaults(encrypt(d)); return module.exports; }, overrides: d => { nconf.overrides(encrypt(d));
0
3
2
46 47 48 49 50 51 52 53 54 55 56
function loadConfig(configFile) { nconf.file({ file: configFile, }); nconf.defaults({ base_dir: paths.baseDir, themes_path: paths.themes, upload_path: 'public/uploads', views_dir: path.join(paths.baseDir, 'build/public/templates'),
0
2
5
+ 2 other calls in file
52 53 54 55 56 57 58 59 60 61
nconf.env({ logicalSeparator: '.', whitelist: this.whitelist, }) nconf.defaults(this.defaults) nconf.load() logger(`config ready: ${this.basePath}/${file_name}`) this.started = true
0
0
2
+ 3 other calls in file
21 22 23 24 25 26 27 28 29 30
nconf.file('base.yaml', { file: 'config/base.yaml', format: yaml }); // // 5. Any default values // // nconf.defaults({ // 'if nothing else': 'use this value' // }); // Validate that there aren't missing values
0
0
2