-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.ts
63 lines (61 loc) · 1.26 KB
/
utils.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
export function mapHostToTenant(host: string) {
console.log('host', host);
switch (host) {
case "localhost:5000": {
return {
tenantId: "localhost",
config: {
CFG_SITE_NAME: "TIND",
},
pageInfo: "Local Institute of Fictive Science",
};
}
case "localhost:3000": {
return {
tenantId: "localhost",
config: {
CFG_SITE_NAME: "TIND",
},
};
}
case "tind2-qa.tind.io": {
return {
tenantId: "tind2-qa",
config: {
CFG_SITE_NAME: "TIND QA",
},
};
}
case "tind2-ante.tind.io": {
return {
tenantId: "tind2-ante",
config: {
CFG_SITE_NAME: "TIND Ante",
},
};
}
case "tind2-test.tind.io": {
return {
tenantId: "tind2-test",
config: {
CFG_SITE_NAME: "TIND Test",
},
};
}
default: {
return {
tenantId: "unknown",
config: {
CFG_SITE_NAME: "unknown"
}
};
}
}
}
export async function getPageInfo(host: string) {
const { tenantId }: any = mapHostToTenant(host);
return {
tenantId,
// ...(await fetch("neki url", { headers: { TENANT_ID: tenantId } })),
};
}