-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathenv.server.js
More file actions
executable file
·72 lines (67 loc) · 1.78 KB
/
env.server.js
File metadata and controls
executable file
·72 lines (67 loc) · 1.78 KB
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
/**
* Configure Server Environment
*
* Usage:
* const domains = require('../../env.server').domains
* const env = require('../../env.server')()
* env.DB_BASE_URL
*/
const env = require('./dna/rna/registry.environment')
const environment = () => {
switch (process.env.NODE_ENV) {
case 'production':
return {
BASE_URL:
(typeof window !== 'undefined' && window.location.origin) ||
'http://localhost:3000',
DB_NAME: 'json',
DB_BASE_URL: '',
DB_USER: '',
DB_PASSWORD: '',
WS_ENABLED: env.flags.WEB_SOCKETS_ENABLED
}
case 'development':
if (process.env.NODE_SERVER === 'local') {
return {
BASE_URL: 'http://localhost:3000',
DB_BASE_URL: '',
DB_USER: '',
DB_PASSWORD: '',
WS_ENABLED: env.flags.WEB_SOCKETS_ENABLED
}
}
return {
BASE_URL: 'http://localhost:3000',
DB_BASE_URL: '',
DB_USER: '',
DB_PASSWORD: '',
WS_ENABLED: env.flags.WEB_SOCKETS_ENABLED
}
default:
return {
BASE_URL: ''
}
}
}
environment.eid = '101'
environment.domainName = env.domains.default.split('//')[1]
environment.changelog = {}
environment.schedulers = {
backup: {
cron: '0 0 4 * * *',
config: {}
}
}
environment.connectors = {
elasticsearch: {},
firebase: {}
}
/**
* Domains
*/
environment.domains = env.domains
/**
* locale
*/
environment.locales = env.locales
module.exports = environment