summary refs log tree commit diff
path: root/api/src
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-13 20:54:59 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-13 20:54:59 +0200
commit63343eec4c49c1d583e5381613ea653cf75f5c58 (patch)
treeddb153b2c4e938e6fe562cd866643d4bdff92d37 /api/src
parent:pencil: update readme (diff)
parent:bug: fix dependencies and build for bundle (diff)
downloadserver-63343eec4c49c1d583e5381613ea653cf75f5c58.tar.xz
Merge branch 'master' of https://github.com/fosscord/fosscord-api
Diffstat (limited to 'api/src')
-rw-r--r--api/src/middlewares/TestClient.ts9
1 files changed, 4 insertions, 5 deletions
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); });