summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-07-22 14:04:24 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-07-22 14:04:24 +0200
commitf7e3809d7ee69eb925dff6f9cde25b986d3bd5ab (patch)
treefa2b78994847d19098d1c90b37965d3e52a34643 /src
parentnpm i @fosscord/server-util@1.32 (diff)
downloadserver-f7e3809d7ee69eb925dff6f9cde25b986d3bd5ab.tar.xz
:bug: fix 404 error return json instead of client
Diffstat (limited to 'src')
-rw-r--r--src/Server.ts8
1 files changed, 8 insertions, 0 deletions
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" });