-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
167 lines (163 loc) · 4.94 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
var npmInfo = require('./package.json');
module.exports = function(){
console.log("Node Env Variable: " + process.env.NODE_ENV);
// istanbul ignore next: don't look at the env variables
switch(process.env.NODE_ENV){
case null:
case undefined:
case "local":
return {
env: 'local', //should be env/prod
dbURI : "mongodb://localhost/" + npmInfo.name,
apiURI : "http://localhost",
apiDomain : "localhost", //TODO use path from apiURI
expressPort: 3000,
loggerLevel: 'info',
appName: 'lightTribe', // we use this for cloudinary name
github: {
name: 'lightTribe', // repo name in github
pagesURL: 'http://codehatcher.github.io/lightTribe'
},
google: {
places: {
apiKey: 'AIzaSyAnojt8rFHBUdU6yvlYL8ZSTjxnjsScdSw'
}
},
cloudinary: {
cloud_name: 'codehatcher',
api_key: '351392996945264',
api_secret: '9K-IqFmehCD_zwSo8w_FhruOgjw'
},
facebook: {
clientID: '1658513671063290',
clientSecret: '5e0fe3da8d2b4fb85688ab297635abb9'
},
swagger: {
// make sure responses to client are validated automatically against schema
validateResponse: false
},
cert: { // apple certificate password
passphrase: '123',
filename: 'dev.p12',
production: false,
feedbackInterval: 1
}
};
case "dev":
case "development":
return {
env: 'dev', //should be env/prod
dbURI : process.env.MONGODB_URI,
expressPort: process.env.PORT,
apiURI: process.env.apiURI,
apiDomain : process.env.apiDomain,
loggerLevel: 'info',
appName: 'lightTribe',
github: {
name: 'lightTribe', // repo name in github
pagesURL: 'http://codehatcher.github.io/lightTribe'
},
google: {
places: {
apiKey: 'AIzaSyAnojt8rFHBUdU6yvlYL8ZSTjxnjsScdSw'
}
},
cloudinary: {
cloud_name: 'codehatcher',
api_key: '351392996945264',
api_secret: process.env.cloudinarySecret
},
facebook: {
clientID: '1510728902576093',
clientSecret: process.env.facebookSecret
},
swagger: {
validateResponse: false
},
cert: { // apple certificate password
passphrase: '123',
filename: 'dev.p12',
production: false,
feedbackInterval: 10
}
};
case "test":
case "testing":
return {
env: 'test', //should be env/prod, can be changed to prod when we are comfy with prod environ
dbURI : process.env.MONGODB_URI,
expressPort: process.env.PORT,
apiURI: process.env.apiURI,
apiDomain : process.env.apiDomain,
loggerLevel: 'debug',
appName: 'lightTribe',
github: {
name: 'lightTribe', // repo name in github
pagesURL: 'http://codehatcher.github.io/lightTribe'
},
google: {
places: {
apiKey: 'AIzaSyAnojt8rFHBUdU6yvlYL8ZSTjxnjsScdSw'
}
},
cloudinary: {
cloud_name: 'codehatcher',
api_key: '351392996945264',
api_secret: process.env.cloudinarySecret
},
facebook: {
clientID: '1658513671063290',
clientSecret: process.env.facebookSecret
},
swagger: {
validateResponse: false
},
cert: { // apple certificate password
passphrase: '123',
filename: 'dev.p12',
production: false,
feedbackInterval: 10
}
};
case "prod":
case "production":
return {
env: 'prod', //should be env/prod, can be changed to prod when we are comfy with prod environ
dbURI : process.env.MONGODB_URI,
expressPort: process.env.PORT,
apiURI: process.env.apiURI,
apiDomain : process.env.apiDomain,
loggerLevel: 'debug',
appName: 'lightTribe',
github: {
name: 'lightTribe', // repo name in github
pagesURL: 'http://codehatcher.github.io/lightTribe'
},
google: {
places: {
apiKey: 'AIzaSyAnojt8rFHBUdU6yvlYL8ZSTjxnjsScdSw'
}
},
cloudinary: {
cloud_name: 'codehatcher',
api_key: '351392996945264',
api_secret: process.env.cloudinarySecret
},
facebook: {
clientID: '1658513671063290',
clientSecret: process.env.facebookSecret
},
swagger: {
validateResponse: false
},
cert: { // apple certificate password
passphrase: process.env.certPassphrase,
filename: 'prod.p12',
production: true,
feedbackInterval: 300
}
};
default:
throw new Error("Environment Not Recognized");
}
}();