From 674fa8364ed36e09bb428d4d063646930b560828 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sat, 20 Aug 2022 19:24:20 +0200 Subject: Improve first setup, make server load initial configuraiton --- src/api/middlewares/TestClient.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/api/middlewares/TestClient.ts') diff --git a/src/api/middlewares/TestClient.ts b/src/api/middlewares/TestClient.ts index 2c872068..2784c8ab 100644 --- a/src/api/middlewares/TestClient.ts +++ b/src/api/middlewares/TestClient.ts @@ -94,11 +94,8 @@ export default function TestClient(app: Application) { } function applyEnv(html: string): string { - const CDN_ENDPOINT = (Config.get().cdn.endpointClient || Config.get()?.cdn.endpointPublic || process.env.CDN || "").replace( - /(https?)?(:\/\/?)/g, - "" - ); - const GATEWAY_ENDPOINT = Config.get().gateway.endpointClient || Config.get()?.gateway.endpointPublic || process.env.GATEWAY || ""; + const CDN_ENDPOINT = (Config.get()?.cdn.endpointPublic || process.env.CDN || "").replace(/(https?)?(:\/\/?)/g, ""); + const GATEWAY_ENDPOINT = Config.get()?.gateway.endpointPublic || process.env.GATEWAY || ""; if (CDN_ENDPOINT) { html = html.replace(/CDN_HOST: .+/, `CDN_HOST: \`${CDN_ENDPOINT}\`,`); -- cgit 1.5.1