From 3254c31e028ca32a8b00753dabde3f984f8a1524 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 30 May 2021 01:44:15 +0200 Subject: :sparkles: user avatar --- src/Server.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/Server.ts') diff --git a/src/Server.ts b/src/Server.ts index 79a8bba3..0ff4df8c 100644 --- a/src/Server.ts +++ b/src/Server.ts @@ -97,7 +97,7 @@ export class FosscordServer extends Server { app.use("/api/v8", prefix); this.app = app; this.app.use(ErrorHandler); - const indexHTML = await fs.readFile(path.join(__dirname, "..", "client_test", "index.html")); + const indexHTML = await fs.readFile(path.join(__dirname, "..", "client_test", "index.html"), { encoding: "utf8" }); this.app.use("/assets", express.static(path.join(__dirname, "..", "assets"))); @@ -143,7 +143,12 @@ export class FosscordServer extends Server { this.app.get("*", (req, res) => { res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24); res.set("content-type", "text/html"); - res.send(indexHTML); + res.send( + indexHTML.replace( + /CDN_HOST: ".+"/, + `CDN_HOST: "${(Config.get().cdn.endpoint || "http://localhost:3003").replace(/https?:/, "")}"` + ) + ); }); return super.start(); } -- cgit 1.5.1