-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglobal.js
34 lines (29 loc) · 995 Bytes
/
global.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
const palette = [
/* Name: Black */
"#010101",
/* Sea Serpent */
"#69c9d0",
/* White */
"#ffffff",
/* Crayola's Red */
"#ee1d52" ];
const TTBLACK = "#010101";
const TTBLUE = "#69c9d0";
const TTRED = "#ee1d52";
const ICBLUISH = "#766ce9";
const ICREDDISH = "#e35187";
function buildApiUrl(apiName, option, apiv) {
// const SERVER = 'https://tiktok.tracking.exposed';
const SERVER = 'http://localhost:14000';
let rv = null;
const api_path = apiv ? `/api/v${apiv}/` : "/api/v1/";
if (window.location.origin.match(/localhost/)) {
const x = SERVER;
rv = option ? `${x}${api_path}${apiName}/${option}` : `${x}${api_path}${apiName}`;
console.log(`Builing URL by hardcoded domains (development) URL composed ${rv}`);
} else {
rv = option ? `${api_path}${apiName}/${option}` : `${api_path}${apiName}`;
console.log(`Building URL by window...href (production) URL composed ${rv}`);
}
return rv;
}