From 1435f58d8474609f176e68eaef7c9161b935720e Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sat, 27 Aug 2022 09:47:26 +0200 Subject: This is for later --- src/api/middlewares/TestClient.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/api') diff --git a/src/api/middlewares/TestClient.ts b/src/api/middlewares/TestClient.ts index 3afd0339..480d7f0b 100644 --- a/src/api/middlewares/TestClient.ts +++ b/src/api/middlewares/TestClient.ts @@ -82,6 +82,15 @@ export default function TestClient(app: Application) { res.send(fs.readFileSync(path.join(__dirname, "..", "..", "..", "assets", "developers.html"), { encoding: "utf8" })); }); + app.get("/popout", (_req: Request, res: Response) => { + const { useTestClient } = Config.get().client; + res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24); + res.set("content-type", "text/html"); + + if (!useTestClient) return res.send("Test client is disabled on this instance. Use a stand-alone client to connect this instance."); + + res.send(fs.readFileSync(path.join(__dirname, "..", "..", "..", "assets", "popout.html"), { encoding: "utf8" })); + }); app.get("*", (req: Request, res: Response) => { const { useTestClient } = Config.get().client; res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24); -- cgit 1.5.1