This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.js
61 lines (58 loc) · 2.42 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* Copyright (c) 2018, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or
* https://opensource.org/licenses/BSD-3-Clause
*/
/* eslint no-process-env: 0 */
/**
* config.js
* Config file for different deployments - dev, staging, production
*/
const DEFAULT_PORT = 5000;
const pollingDelay = 20000;
module.exports = {
env: process.env.NODE_ENV || 'dev',
port: process.env.PORT || DEFAULT_PORT,
pdToken: process.env.PD_TOKEN,
pdSender: process.env.PD_SENDER,
tteToggle: process.env.TTE_TOGGLE || false,
dev: {
refocusUrl: process.env.REFOCUS_URL_DEV ||
'http://localhost:3000',
refocusRealtimeUrl: process.env.REFOCUS_REALTIME_URL_DEV,
recommendationUrl: process.env.RECOMMENDATION_URL_DEV,
token: process.env.API_TOKEN_DEV,
pollingDelay: process.env.POLLING_DELAY_DEV || pollingDelay,
useNewPDBridge: process.env.USE_NEW_PD_BRIDGE_DEV || false,
pdBridgeUrl: process.env.PD_BRIDGE_URL_DEV || null,
redisCacheUrl: process.env.REDIS_URL || 'redis://127.0.0.1:6379',
redisCachePassword: process.env.CACHE_REDIS_PASSWORD_DEV,
useRedisCache: process.env.USE_REDIS_CACHE_DEV === 'true' || false,
},
sandbox: {
refocusUrl: process.env.REFOCUS_URL_SANDBOX,
refocusRealtimeUrl: process.env.REFOCUS_REALTIME_URL_SANDBOX,
recommendationUrl: process.env.RECOMMENDATION_URL_SANDBOX,
token: process.env.API_TOKEN_SANDBOX,
pollingDelay: process.env.POLLING_DELAY_SANDBOX || pollingDelay,
useNewPDBridge: process.env.USE_NEW_PD_BRIDGE_SANDBOX || false,
pdBridgeUrl: process.env.PD_BRIDGE_URL_SANDBOX || null,
redisCacheUrl: process.env.REDIS_URL,
redisCachePassword: process.env.CACHE_REDIS_PASSWORD_SANDBOX,
useRedisCache: process.env.USE_REDIS_CACHE_SANDBOX === 'true' || false,
},
production: {
refocusUrl: process.env.REFOCUS_URL_PROD,
refocusRealtimeUrl: process.env.REFOCUS_REALTIME_URL_PROD,
recommendationUrl: process.env.RECOMMENDATION_URL_PROD,
token: process.env.API_TOKEN_PROD,
pollingDelay: process.env.POLLING_DELAY_PROD || pollingDelay,
useNewPDBridge: process.env.USE_NEW_PD_BRIDGE_PROD || false,
pdBridgeUrl: process.env.PD_BRIDGE_URL_PROD || null,
redisCacheUrl: process.env.REDIS_URL,
redisCachePassword: process.env.CACHE_REDIS_PASSWORD_PROD,
useRedisCache: process.env.USE_REDIS_CACHE_PROD === 'true' || false,
},
};