-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.js
40 lines (31 loc) · 817 Bytes
/
conf.js
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
35
36
37
38
39
40
// Server Configuration
var conf = {};
// Shared configuration between dev and production
conf.joe = "HEY THERE";
// Development configuration
if (process.env.NODE_ENV === 'development') {
conf.mongo_config = {
'dbname' : 'things',
'host' : 'localhost',
'port' : 27017,
connect_string: function(){
return 'mongodb://' + this.host + ':' + this.port + '/' + this.dbname;
}
};
}
// Production configuration
if (process.env.NODE_ENV === 'production') {
conf.mongo_config = {
'dbname' : 'base-auth-prod',
'host' : 'some.prod.db',
'port' : 12345,
'auth' : {
'name': 'XXXXXXXX',
'pass': 'XXXXXXXX'
},
connect_string: function(){
return 'mongodb://' + this.auth.name + ':' + this.auth.pass + '@' + this.host + ':' + this.port + '/' + this.dbname;
}
};
}
module.exports = conf;