-
Notifications
You must be signed in to change notification settings - Fork 8
/
env.example.js
64 lines (52 loc) · 1.38 KB
/
env.example.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import Constants from 'expo-constants';
const HOST = '';
const DEVELOPMENT_MODE_API_URL = ``;
const DEVELOPMENT_MODE_BROADCAST_URL = ``;
const STAGING_MODE_API_URL = ``;
const STAGING_MODE_BROADCAST_URL = ``;
const PRODUCTION_MODE_API_URL = ``;
const PRODUCTION_MODE_BROADCAST_URL = ``;
const WEB_APP_URL = '';
const PUSHER_CONFIG =
{
WS_PORT: 6001,
DRIVER: '',
APP_ID: '',
APP_KEY: '',
APP_SECRET: '',
APP_CLUSTER: '',
HOST,
WEBSOCKET_HOST: ``
}
const ENVIRONMENT_VARIABLES =
{
dev: {
API_URL: DEVELOPMENT_MODE_API_URL,
BROADCAST_URL: DEVELOPMENT_MODE_BROADCAST_URL,
PUSHER_CONFIG,
WEB_APP_URL
},
staging: {
API_URL: STAGING_MODE_API_URL,
BROADCAST_URL: STAGING_MODE_BROADCAST_URL,
PUSHER_CONFIG,
WEB_APP_URL
},
production: {
API_URL: PRODUCTION_MODE_API_URL,
BROADCAST_URL: PRODUCTION_MODE_BROADCAST_URL,
PUSHER_CONFIG,
WEB_APP_URL
}
};
const env = () =>
{
const env = Constants.manifest.releaseChannel;
const { dev, staging, production } = ENVIRONMENT_VARIABLES;
if (env === null || env === undefined || env === "") return dev;
if (env.indexOf('dev') !== -1) return dev;
if (env.indexOf('staging') !== -1) return staging;
if (env.indexOf('prod') !== -1) return production;
}
const ENV = env();
export default ENV;