-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.js
More file actions
29 lines (23 loc) · 990 Bytes
/
config.js
File metadata and controls
29 lines (23 loc) · 990 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
const isEnvProduction = process.env.NODE_ENV === 'production'
const isEnvDevelopment = process.env.NODE_ENV === 'development'
const DOMAIN = isEnvProduction ? 'xn--7ov117aclgs4c.life' : 'localhost'
const LOCAL_SERVER_HOST = 'http://localhost:8080'
const LOCAL_API_HOST = LOCAL_SERVER_HOST + '/api' // local server
const HOST = isEnvProduction ? `https://${DOMAIN}` : `http://${DOMAIN}:3001`
const API_HOST = isEnvProduction ? `https://api.${DOMAIN}/api` : `/api` // /api is the proxy path
const ADMIN_HOST = isEnvProduction ? `https://admin.${DOMAIN}` : `http://localhost:8888`
const STORAGE_HOST = isEnvProduction ? `https://storge.${DOMAIN}` : `${LOCAL_SERVER_HOST}`
const s = (s) => JSON.stringify(s)
module.exports = {
__ENV__: {
__DEV__: isEnvDevelopment,
__DOMAIN__: s(DOMAIN),
__HOST__: s(HOST),
__API_HOST__: s(API_HOST),
__STORAGE_HOST__: s(STORAGE_HOST),
__ADMIN_HOST__: s(ADMIN_HOST)
},
isEnvProduction,
isEnvDevelopment,
LOCAL_API_HOST
}