-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
30 lines (24 loc) · 844 Bytes
/
Copy pathconfig.js
File metadata and controls
30 lines (24 loc) · 844 Bytes
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
/*
* Create and export configuration variables
*
*/
// Container for all the environment
const environments = {};
// Staging (default) environment
environments.staging = {
'httpPort' : 3300,
'httpsPort' : 3301,
'envName' : 'staging'
};
// Production environment
environments.production = {
'httpPort' : 5500,
'httpsPort' : 5501,
'envName' : 'production'
};
// Determine 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 is one of the environment above, if not, default to staging
var environmentToExport = typeof(environments[currentEnvironment]) == 'object' ? environments[currentEnvironment] : environments.staging;
// Export the module
module.exports = environmentToExport;