diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-13 12:59:59 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-13 12:59:59 +0200 |
commit | 3715807cf7bc1745dc76c735bf7f4006faff350e (patch) | |
tree | 3d2b38a2c0889a6e5019c06ad150711237dff48f /api/src/Server.ts | |
parent | :sparkles: server bundle (diff) | |
download | server-3715807cf7bc1745dc76c735bf7f4006faff350e.tar.xz |
rename @fosscord/server-util to -> @fosscord/util
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; |