-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathenv.client.js
executable file
·48 lines (44 loc) · 1.32 KB
/
env.client.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
/**
* Configure Browser Environment
*
* Usage:
* const env = require('../../../env.client')()
* env.BASE_URL
*/
import {locales, flags, domains} from './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',
DOMAIN_URL: domains.default,
WS_ENABLED: flags.WEB_SOCKETS_ENABLED
}
case 'development':
if (process.env.NODE_SERVER === 'local') {
return {
BASE_URL: 'http://localhost:3000',
DOMAIN_URL: domains.default,
WS_ENABLED: flags.WEB_SOCKETS_ENABLED
}
}
return {
BASE_URL: 'http://localhost:3000',
DOMAIN_URL: domains.default,
WS_ENABLED: flags.WEB_SOCKETS_ENABLED
}
default:
return {
BASE_URL: 'http://localhost:3000',
DOMAIN_URL: domains.default,
WS_ENABLED: flags.WEB_SOCKETS_ENABLED
}
}
}
/**
* locale
*/
environment.locales = locales
module.exports = environment