-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathproduction.js
37 lines (32 loc) · 970 Bytes
/
production.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
'use strict';
// Production specific configuration
// =================================
// cloud foundry
var getCfMongo = function() {
var vcapServices = JSON.parse(process.env.vcapServices);
var mongoUri;
if (vcapServices.mongolab && vcapServices.mongolab.length > 0) {
mongoUri = vcapServices.mongolab[0].credentials.uri;
}
return mongoUri;
};
module.exports = {
// Server IP
ip: process.env.OPENSHIFT_NODEJS_IP ||
process.env.IP ||
undefined,
// Server port
port: process.env.OPENSHIFT_NODEJS_PORT ||
process.env.PORT ||
process.env.VCAP_APP_PORT ||
8080,
// MongoDB connection options
mongo: {
uri: process.env.MONGOLAB_URI ||
process.env.MONGOHQ_URL ||
process.env.OPENSHIFT_MONGODB_DB_URL +
process.env.OPENSHIFT_APP_NAME ||
getCfMongo() ||
'mongodb://localhost/<%= _.slugify(appname) %>'
}
};