-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
65 lines (56 loc) · 1.53 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
/*
* Create and export configuration variables
*
*/
//Container for all the environments
var environments = {};
//Staging (default) environment
environments.staging = {
httpPort: 3000,
httpsPort: 3001,
envName: "staging",
hashingSecret: "ehrv4viuguh3o2ihcoi32h4o2y4",
maxChecks: 5,
twilio: {
accountSid: "AC1918fd53b8a7d18d8faf58b9c33aa283",
authToken: "720ca20c5a32dc95898ada3e7f87425f",
fromPhone: "+15005550006"
},
templateGlobals: {
appName: "Uptime Checker",
companyName: "orilliance",
yearCreated: "2018",
baseUrl: "http://localhost:3000/"
}
};
//Production Environment
environments.production = {
httpPort: 5000,
httpsPort: 5001,
envName: "production",
hashingSecret: "8y48ybc384y23ehru3yriqwjqiy384",
maxChecks: 5,
twilio: {
accountSid: "AC1918fd53b8a7d18d8faf58b9c33aa283",
authToken: "720ca20c5a32dc95898ada3e7f87425f",
fromPhone: "+15005550006"
},
templateGlobals: {
appName: "Uptime Checker",
companyName: "orilliance",
yearCreated: "2018",
baseUrl: "http://localhost:3000/"
}
};
//Determines which environment was passed as a command-line argument
var currentEnvironment =
typeof process.env.NODE_ENV === "string"
? process.env.NODE_ENV.toLowerCase()
: "";
// Check that the current environment above, if not, default is staging
var environmentToExport =
typeof environments[currentEnvironment] === "object"
? environments[currentEnvironment]
: environments.staging;
// Export the module
module.exports = environmentToExport;