diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-13 13:03:18 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-13 13:03:18 +0200 |
commit | a687b489d745c52e207637b6595edcb3eabe8f2d (patch) | |
tree | 98d45b035c2c9589d9702a9a2f442b62f9a3ab99 /api/src/Server.ts | |
parent | Fix naming (diff) | |
parent | abstract Event emission (diff) | |
download | server-a687b489d745c52e207637b6595edcb3eabe8f2d.tar.xz |
Merge branch 'master' into pr/darkhpp/261-2
Diffstat (limited to 'api/src/Server.ts')
-rw-r--r-- | api/src/Server.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/api/src/Server.ts b/api/src/Server.ts index 7299425a..a60c5e4d 100644 --- a/api/src/Server.ts +++ b/api/src/Server.ts @@ -3,7 +3,7 @@ import fs from "fs"; import { Connection } from "mongoose"; import { Server, ServerOptions } from "lambert-server"; import { Authentication, CORS } from "./middlewares/"; -import { Config, db, RabbitMQ } from "@fosscord/server-util"; +import { Config, db, initEvent, RabbitMQ } from "@fosscord/util"; import i18next from "i18next"; import i18nextMiddleware, { I18next } from "i18next-http-middleware"; import i18nextBackend from "i18next-node-fs-backend"; @@ -56,9 +56,8 @@ export class FosscordServer extends Server { // @ts-ignore await (db as Promise<Connection>); await this.setupSchema(); - console.log("[Database] connected"); await Config.init(); - await RabbitMQ.init(); + await initEvent(); this.app.use(CORS); this.app.use(Authentication); @@ -93,11 +92,12 @@ export class FosscordServer extends Server { app.use("/api/v9", api); app.use("/api", api); // allow unversioned requests - api.get("*", (req: Request, res: Response) => { + api.get("*", (req: Request, res: Response, next) => { res.status(404).json({ message: "404: Not Found", code: 0 }); + next(); }); this.app = app; |