-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ts
46 lines (42 loc) · 1.35 KB
/
config.ts
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
type DevMode = "PRODUCTION" | "DEVELOPMENT";
const DEV_MODE: DevMode = "PRODUCTION";
const PAYLOAD_LIMIT_MAX_KB_SIZE = 1024;
const CONFIG_INNER = {
PRODUCT_NAME: "CodeBud",
MAX_IDENTICAL_CONSOLE_WARNINGS_IN_A_ROW: 3,
DOMAIN: "codebud.io",
MAIN_URL: "https://codebud.io",
BASE_URL: 'https://codebud.io/api/v3',
DEV: {
"PRODUCTION": false,
"DEVELOPMENT": true
},
MAIN_SOCKET_ADDRESS: {
"PRODUCTION": "https://codebud.io",
"DEVELOPMENT": "http://192.168.0.14:3000"
},
SOCKET_PATH: {
"PRODUCTION": "/connect/socket.io",
"DEVELOPMENT": ""
},
SOCKET_RECONNECTION_DELAY: 5e3,
NETWORK_INTERCEPTOR: {
FILTER_INNER_REQUESTS: {
"PRODUCTION": true,
"DEVELOPMENT": true
}
},
PAYLOAD_LIMITS: {
MAX_KB_SIZE: PAYLOAD_LIMIT_MAX_KB_SIZE,
MAX_BYTE_SIZE: 1024 * PAYLOAD_LIMIT_MAX_KB_SIZE,
MIN_STRING_LENGTH_POSSIBLE_OVERLOAD: 1024 * PAYLOAD_LIMIT_MAX_KB_SIZE / 4, // MAX_BYTE_SIZE / 4 (4 is max possible byteSize of UTF char)
MAX_KEYS_IN_STORAGE: 2048
}
};
export const CONFIG = {
...CONFIG_INNER,
DEV: CONFIG_INNER.DEV[DEV_MODE],
MAIN_SOCKET_ADDRESS: CONFIG_INNER.MAIN_SOCKET_ADDRESS[DEV_MODE],
SOCKET_PATH: CONFIG_INNER.SOCKET_PATH[DEV_MODE],
NETWORK_INTERCEPTOR: {...CONFIG_INNER.NETWORK_INTERCEPTOR, FILTER_INNER_REQUESTS: CONFIG_INNER.NETWORK_INTERCEPTOR.FILTER_INNER_REQUESTS[DEV_MODE]}
};