summary refs log tree commit diff
path: root/api/src/Server.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-15 00:44:19 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-15 00:44:19 +0200
commit288eeab6bbb793473788dffa1cae68790ead6d0e (patch)
tree3b60a63f8a7c6317cb43fda1f7ab29993814b587 /api/src/Server.ts
parentfeat: implement a database check on the healthz and readyz probes, remove /-/... (diff)
parent:art: do not automatically create default guild (diff)
downloadserver-288eeab6bbb793473788dffa1cae68790ead6d0e.tar.xz
Merge branch 'master' into pr/hbjydev/454
Diffstat (limited to 'api/src/Server.ts')
-rw-r--r--api/src/Server.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/api/src/Server.ts b/api/src/Server.ts

index 12c1d6b4..1f11a295 100644 --- a/api/src/Server.ts +++ b/api/src/Server.ts
@@ -1,19 +1,17 @@ -import { OptionsJson } from "body-parser"; import "missing-native-js-functions"; -import { Connection } from "mongoose"; import { Server, ServerOptions } from "lambert-server"; import { Authentication, CORS } from "./middlewares/"; import { Config, initDatabase, initEvent } from "@fosscord/util"; import { ErrorHandler } from "./middlewares/ErrorHandler"; import { BodyParser } from "./middlewares/BodyParser"; import { Router, Request, Response, NextFunction } from "express"; -import mongoose from "mongoose"; import path from "path"; import { initRateLimits } from "./middlewares/RateLimit"; import TestClient from "./middlewares/TestClient"; import { initTranslation } from "./middlewares/Translation"; import morgan from "morgan"; import { initInstance } from "./util/Instance"; +import { registerRoutes } from "@fosscord/util"; export interface FosscordServerOptions extends ServerOptions {} @@ -75,7 +73,7 @@ export class FosscordServer extends Server { await initRateLimits(api); await initTranslation(api); - this.routes = await this.registerRoutes(path.join(__dirname, "routes", "/")); + this.routes = await registerRoutes(this, path.join(__dirname, "routes", "/")); api.use("*", (error: any, req: Request, res: Response, next: NextFunction) => { if (error) return next(error);