-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
39 lines (35 loc) · 829 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
35
36
37
38
39
const env = process.env.NODE_ENV;
/**
* Client related confiog
*/
const client = {
type: 'client',
app: {
port: process.env.PORT || 3000,
backendIp: process.env.BACKEND_IP || '127.0.0.1',
frontendPort: process.env.FRONTEND_PORT || 8080,
frontend: process.env.FRONTEND || false,
database: process.env.DATABASE || true
},
identity: process.env.IDENTITY || `peer-${Math.random().toString(36).substr(2, 9)}`,
verbose: process.env.VERBOSE || false
};
/**
* Server related config
*/
const server = {
type: 'server',
app: {
port: process.env.PORT || 3000,
frontendPort: process.env.FRONTEND_PORT || 8080
},
verbose: process.env.VERBOSE || false
};
/**
* Creates an object so it easier accessible via the environment variable
*/
const config = {
client,
server
};
module.exports = config[env];