forked from TaichiHo/Pikachu
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathconfig.js
More file actions
36 lines (27 loc) · 831 Bytes
/
config.js
File metadata and controls
36 lines (27 loc) · 831 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
35
36
/**
* App configuration
*/
var config = {};
config.targetUrl = "www.xiachufang.com";
config.initialPort = 80;
config.initialPath = "/";
config.mongodb = {};
config.elasticsearch = {};
// 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:27018/pikachu';
}
config.elasticsearch.url = 'localhost:9200';
module.exports = config;