forked from allank/responsive-pulse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
executable file
·56 lines (42 loc) · 1.37 KB
/
config.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Set the current environment to true in the env object
var currentEnv = process.env.NODE_ENV || 'development';
// Import local environment variables from config/local.js
var local = require('./config/local');
exports.appName = 'ucros';
exports.env = {
production: true,
staging: false,
test: false,
development: false
};
exports.env[ currentEnv ] = true;
exports.log = {
path: __dirname + '/var/log/app_#{currentEnv}.log'
};
exports.server = {
port: process.env.PORT || 4600,
// In staging and production, listen loopback. nginx listens on the network.
ip: '127.0.0.1'
};
if( currentEnv != 'production' && currentEnv != 'staging' ) {
exports.enableTests = true;
// Listen on all IPs in dev/test (for testing from other machines)
exports.server.ip = '0.0.0.0';
}
exports.db = {
ip: '127.0.0.1',
port: 27017,
database: exports.appName + '_' + currentEnv
};
exports.db.url = 'mongodb://' + exports.db.ip + ':' + exports.db.port + '/' + exports.db.database;
exports.auth = local.auth;
exports.session = local.session;
if( currentEnv === 'production' ) {
exports.baseUrl = local.url.production;
} else if( currentEnv === 'staging' ) {
exports.baseUrl = local.url.staging;
} else {
exports.baseUrl = 'http://' + exports.server.ip + ':' + exports.server.port;
}
exports.surveyVersion = "20150331";
exports.email = local.email;