From 16eff151ea7d7f90c095f085d8e4a6d69e26dbe6 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Fri, 13 Aug 2021 20:53:29 +0200 Subject: :bug: fix dependencies and build for bundle --- api/src/middlewares/TestClient.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'api/src/middlewares') diff --git a/api/src/middlewares/TestClient.ts b/api/src/middlewares/TestClient.ts index 45b8a072..f93d0b3a 100644 --- a/api/src/middlewares/TestClient.ts +++ b/api/src/middlewares/TestClient.ts @@ -1,6 +1,4 @@ -import bodyParser, { OptionsJson } from "body-parser"; -import express, { NextFunction, Request, Response, Application } from "express"; -import { HTTPError } from "lambert-server"; +import express, { Request, Response, Application } from "express"; import fs from "fs"; import path from "path"; import fetch, { Response as FetchResponse } from "node-fetch"; @@ -58,8 +56,9 @@ export default function TestClient(app: Application) { const CDN_ENDPOINT = (Config.get()?.cdn.endpoint || process.env.CDN || "").replace(/(https?)?(:\/\/?)/g, ""); const GATEWAY_ENDPOINT = Config.get()?.gateway.endpoint || process.env.GATEWAY || ""; - if (CDN_ENDPOINT) html = html.replace(/CDN_HOST: .+/, `CDN_HOST: "${CDN_ENDPOINT}",`); - if (GATEWAY_ENDPOINT) html = html.replace(/GATEWAY_ENDPOINT: .+/, `GATEWAY_ENDPOINT: "${GATEWAY_ENDPOINT}",`); + if (CDN_ENDPOINT && Config.get().cdn.endpointClient) html = html.replace(/CDN_HOST: .+/, `CDN_HOST: "${CDN_ENDPOINT}",`); + if (GATEWAY_ENDPOINT && Config.get().gateway.endpointClient) + html = html.replace(/GATEWAY_ENDPOINT: .+/, `GATEWAY_ENDPOINT: "${GATEWAY_ENDPOINT}",`); res.send(html); }); -- cgit 1.4.1