summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-12-21 19:52:08 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-12-21 19:52:08 +1100
commit22fb62673a6341c86bf3550880caba86cb69ca97 (patch)
tree1cf967ea202ac495bf420c131dc8bf442e3c9390 /src/api
parentMerge branch 'maddy/refactor' of github.com:fosscord/fosscord-server into mad... (diff)
downloadserver-22fb62673a6341c86bf3550880caba86cb69ca97.tar.xz
Disable test client by default
Diffstat (limited to 'src/api')
-rw-r--r--src/api/middlewares/TestClient.ts6
1 files changed, 6 insertions, 0 deletions
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;