-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathconfig.js
More file actions
33 lines (25 loc) · 757 Bytes
/
config.js
File metadata and controls
33 lines (25 loc) · 757 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
/**
* App configuration
*/
var config = {};
config.targetUrl = "www.xiachufang.com";
config.initialPort = 80;
config.initialPath = "/";
config.mongodb = {};
// VCAP_SERVICES
if (process.env.VCAP_SERVICES) {
var vcapServices = JSON.parse(process.env.VCAP_SERVICES);
if (vcapServices['user-provided'] != null) {
var userProvidedServices = vcapServices['user-provided'];
for (var i = 0; i < userProvidedServices.length; i++) {
if (userProvidedServices[i].name == 'mLab') {
config.mongodb.dburl = userProvidedServices[i].credentials.mongodburi;
console.log("Using mLab MongoDB");
}
}
}
}
if (!config.mongodb.dburl) {
config.mongodb.dburl = 'mongodb://localhost:27017/pikachu'
}
module.exports = config;