-
Notifications
You must be signed in to change notification settings - Fork 34
/
constants.js
34 lines (22 loc) · 928 Bytes
/
constants.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
/**
* Created by BIT TECHNOLOGIES on 7/11/2017.
*/
const FRONTEND_URL = process.env.PORT ? `127.0.0.1:${process.env.PORT}` : '127.0.0.1:80';
const BACKEND_URL = '127.0.0.1:4000';
const FRONTEND_WEBSITE_URL = 'http://'+trimSlash(FRONTEND_URL)+'/';
const BACKEND_WEBSITE_URL = 'http://'+trimSlash(BACKEND_URL)+'/';
function trimSlash(site) {
return site.replace(/\/$/, "");
}
module.exports =
{
FRONTEND_URL : FRONTEND_URL,
FRONTEND_WEBSITE_URL : FRONTEND_WEBSITE_URL,
BACKEND_URL : BACKEND_URL,
BACKEND_WEBSITE_URL : BACKEND_WEBSITE_URL,
SERVICE_HTTP_API_URL : trimSlash(BACKEND_WEBSITE_URL) + '/api/',
SERVICE_WEBSOCK_URL : BACKEND_URL,
SERVICE_WEBSOCK_API : 'api/',
SERVICE_FILE_UPLOAD_URL : trimSlash(BACKEND_WEBSITE_URL)+'/upload/image',
SERVICE_FILE_UPLOAD_TOPIC_URL : trimSlash(BACKEND_WEBSITE_URL)+'/upload/topic-file',
};