diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-12-21 19:52:08 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-12-21 19:52:08 +1100 |
commit | 22fb62673a6341c86bf3550880caba86cb69ca97 (patch) | |
tree | 1cf967ea202ac495bf420c131dc8bf442e3c9390 /src | |
parent | Merge branch 'maddy/refactor' of github.com:fosscord/fosscord-server into mad... (diff) | |
download | server-22fb62673a6341c86bf3550880caba86cb69ca97.tar.xz |
Disable test client by default
Diffstat (limited to 'src')
-rw-r--r-- | src/api/middlewares/TestClient.ts | 6 | ||||
-rw-r--r-- | src/util/config/types/ClientConfiguration.ts | 2 |
2 files changed, 7 insertions, 1 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; diff --git a/src/util/config/types/ClientConfiguration.ts b/src/util/config/types/ClientConfiguration.ts index 69b5e154..0d3c8490 100644 --- a/src/util/config/types/ClientConfiguration.ts +++ b/src/util/config/types/ClientConfiguration.ts @@ -2,5 +2,5 @@ import { ClientReleaseConfiguration } from "."; export class ClientConfiguration { releases: ClientReleaseConfiguration = new ClientReleaseConfiguration(); - useTestClient: boolean = true; + useTestClient: boolean = false; } \ No newline at end of file |