mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-11 05:02:37 +01:00
🐛 fix cdn endpoint
This commit is contained in:
parent
2c5cdec381
commit
c66a905274
@ -15,7 +15,7 @@
|
||||
API_VERSION: 9,
|
||||
GATEWAY_ENDPOINT: `${location.protocol === "https:" ? "wss://" : "ws://"}${location.hostname}:3002`,
|
||||
WEBAPP_ENDPOINT: "",
|
||||
CDN_HOST: `//${location.hostname}:3003`,
|
||||
CDN_HOST: `${location.hostname}:3003`,
|
||||
ASSET_ENDPOINT: "",
|
||||
MEDIA_PROXY_ENDPOINT: "https://media.discordapp.net",
|
||||
WIDGET_ENDPOINT: `//${location.host}/widget`,
|
||||
|
@ -55,8 +55,8 @@ export default function TestClient(app: Application) {
|
||||
res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24);
|
||||
res.set("content-type", "text/html");
|
||||
var html = indexHTML;
|
||||
const CDN_ENDPOINT = Config.get().cdn.endpoint || process.env.CDN;
|
||||
const GATEWAY_ENDPOINT = Config.get().gateway.endpoint || process.env.GATEWAY;
|
||||
const CDN_ENDPOINT = Config.get()?.cdn.endpoint || process.env.CDN;
|
||||
const GATEWAY_ENDPOINT = (Config.get()?.gateway.endpoint || process.env.GATEWAY || "").replace(/(https?)?(:\/\/?)/g, "");
|
||||
|
||||
if (CDN_ENDPOINT) html = html.replace(/CDN_HOST: .+/, `CDN_HOST: "${CDN_ENDPOINT}",`);
|
||||
if (GATEWAY_ENDPOINT) html = html.replace(/GATEWAY_ENDPOINT: .+/, `GATEWAY_ENDPOINT: "${GATEWAY_ENDPOINT}",`);
|
||||
|
Loading…
Reference in New Issue
Block a user