-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
34 lines (27 loc) · 788 Bytes
/
config.js
File metadata and controls
34 lines (27 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var path = require('path');
var Nconf = require('nconf');
const _private = {}; // eslint-disable-line no-underscore-dangle
_private.loadNconf = (options = {}) => {
const nconf = new Nconf.Provider();
nconf.overrides({
salt: '!salty'
});
nconf.file('defaults', path.join(__dirname, 'defaults.json'));
//
// Setup nconf to use (in-order):
// 1. Command-line arguments
// 2. Environment variables
// 3. A file located at 'path/to/config.json'
//
// nconf.argv()
// .env()
// .file({ file: 'path/to/config.json' });
//
// Set a few variables on `nconf`.
//
nconf.set('database:host', '127.0.0.1');
nconf.set('database:port', 5984);
return nconf;
}
module.exports.loadNconf = _private.loadNconf;
module.exports = _private.loadNconf();