diff options
Diffstat (limited to 'api/src/middlewares/TestClient.ts')
-rw-r--r-- | api/src/middlewares/TestClient.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/api/src/middlewares/TestClient.ts b/api/src/middlewares/TestClient.ts index 5c0b081b..ecf87681 100644 --- a/api/src/middlewares/TestClient.ts +++ b/api/src/middlewares/TestClient.ts @@ -83,6 +83,15 @@ export default function TestClient(app: Application) { return res.send(buffer); }); + app.get("/developers*", (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, "..", "..", "client_test", "developers.html"), { encoding: "utf8" })); + }); app.get("*", (req: Request, res: Response) => { const { useTestClient } = Config.get().client; res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24); |