-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
34 lines (29 loc) · 905 Bytes
/
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
/*
* Create adn export configuration vars
*/
// Container for all the environments
const environments = {};
// Staging (default) environment
environments.staging = {
"httpPort": 3000,
"httpsPort": 3001,
"envName": "staging",
"hashingSecret": "thisIsASecret",
"maxChecks": 5,
};
// Production environment
environments.production = {
"httpPort": 5000,
"httpsPort": 5001,
"envName": "production",
"hashingSecret": "thisIsAlsoASecret",
"maxChecks": 5,
};
// Determine which environment was passed as a command-line argument
const currentEnvironment = typeof (process.env.NODE_ENV) === "string"
? process.env.NODE_ENV.toLowerCase()
: '';
// Check that the current environment is one of the environments above, if not, default
export const environmentToExport = typeof (environments[currentEnvironment]) === "object"
? environments[currentEnvironment]
: environments.staging;