-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.js
executable file
·69 lines (66 loc) · 1.49 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
57
58
59
60
61
62
63
64
65
66
67
68
69
require('dotenv').config();
exports.config = (function() {
var appDefaults = {
concurrentCalls: 3,
before: 0,
after: 0,
limit: 250,
homeRadius: 50,
cityRadius: 20,
distanceUnit: 'miles',
tripMinimum: 2,
};
var configs = {
remote: {
port: process.env.PORT || 3000,
session: {
secret: process.env.SESSION_SECRET,
age: 60000,
impl: 'memory',
},
zip: {
api: process.env.ZIP_API_ID,
},
foursquare: {
secrets: {
redirectUrl: process.env.FSQ_REDIRECT,
clientId: process.env.FSQ_CLIENT_ID,
clientSecret: process.env.FSQ_CLIENT_SECRET,
},
startYear: 2009,
},
defaults: appDefaults,
},
local: {
port: 3000,
session: {
secret: process.env.SESSION_SECRET,
age: 3000,
impl: 'memory',
},
yahoo: {
appId: 'YOUR APP ID',
},
foursquare: {
secrets: {
redirectUrl: process.env.FSQ_REDIRECT,
clientId: process.env.FSQ_CLIENT_ID,
clientSecret: process.env.FSQ_CLIENT_SECRET,
},
startYear: 2009,
},
defaults: appDefaults,
},
defaultConfig: 'remote',
};
function getConfig(n) {
if (!configs[n]) {
return configs[configs.defaultConfig];
}
return configs[n];
}
return {
configs: configs,
getConfig: getConfig,
};
})();