From 22fb62673a6341c86bf3550880caba86cb69ca97 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Wed, 21 Dec 2022 19:52:08 +1100 Subject: Disable test client by default --- src/api/middlewares/TestClient.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/api') diff --git a/src/api/middlewares/TestClient.ts b/src/api/middlewares/TestClient.ts index 74845f04..a932caf6 100644 --- a/src/api/middlewares/TestClient.ts +++ b/src/api/middlewares/TestClient.ts @@ -11,6 +11,12 @@ export default function TestClient(app: Application) { app.use("/assets", express.static(path.join(ASSET_FOLDER_PATH, "public"))); app.use("/assets", express.static(path.join(ASSET_FOLDER_PATH, "cache"))); + app.get("*", (req, res, next) => { + if (Config.get().client.useTestClient) return next(); + + return res.redirect("/api/ping") + }) + // Test client is disabled, so don't need to run any more. Above should probably be moved somewhere? if (!Config.get().client.useTestClient) return; -- cgit 1.5.1