From f7e3809d7ee69eb925dff6f9cde25b986d3bd5ab Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Thu, 22 Jul 2021 14:04:24 +0200 Subject: :bug: fix 404 error return json instead of client --- src/Server.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/Server.ts b/src/Server.ts index 39b1930d..52e217f8 100644 --- a/src/Server.ts +++ b/src/Server.ts @@ -103,6 +103,14 @@ export class FosscordServer extends Server { app.use("/api/v8", prefix); app.use("/api/v9", prefix); app.use("/api", prefix); // allow unversioned requests + + prefix.get("*", (req: Request, res: Response) => { + res.status(404).json({ + message: "404: Not Found", + code: 0 + }); + }); + this.app = app; this.app.use(ErrorHandler); const indexHTML = fs.readFileSync(path.join(__dirname, "..", "client_test", "index.html"), { encoding: "utf8" }); -- cgit 1.5.1