diff options
author | Featyre <twooter.0g179@simplelogin.co> | 2022-01-26 08:58:36 +0800 |
---|---|---|
committer | Featyre <twooter.0g179@simplelogin.co> | 2022-01-26 08:58:36 +0800 |
commit | b01a26cdceb2840b44da7033e2f6615a27273595 (patch) | |
tree | f133ebfaf2c56e2e9fa1bd1cbb57bb7cf0c1a53e /api/src/middlewares | |
parent | change line (diff) | |
download | server-b01a26cdceb2840b44da7033e2f6615a27273595.tar.xz |
Dev portal + categories load db
Diffstat (limited to 'api/src/middlewares')
-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); |