diff options
Diffstat (limited to 'src/api/Server.ts')
-rw-r--r-- | src/api/Server.ts | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/api/Server.ts b/src/api/Server.ts index 136f9814..e92335a5 100644 --- a/src/api/Server.ts +++ b/src/api/Server.ts @@ -1,16 +1,16 @@ +import { Config, getOrInitialiseDatabase, initEvent, registerRoutes } from "@fosscord/util"; +import { NextFunction, Request, Response, Router } from "express"; import { Server, ServerOptions } from "lambert-server"; +import morgan from "morgan"; +import path from "path"; +import { red } from "picocolors"; import { Authentication, CORS } from "./middlewares/"; -import { Config, getOrInitialiseDatabase, initEvent, registerRoutes } from "@fosscord/util"; -import { ErrorHandler } from "./middlewares/ErrorHandler"; import { BodyParser } from "./middlewares/BodyParser"; -import { Router, Request, Response, NextFunction } from "express"; -import path from "path"; +import { ErrorHandler } from "./middlewares/ErrorHandler"; import { initRateLimits } from "./middlewares/RateLimit"; import TestClient from "./middlewares/TestClient"; import { initTranslation } from "./middlewares/Translation"; -import morgan from "morgan"; import { initInstance } from "./util/handlers/Instance"; -import { red } from "picocolors" export interface FosscordServerOptions extends ServerOptions {} @@ -85,8 +85,13 @@ export class FosscordServer extends Server { this.app.use(ErrorHandler); TestClient(this.app); - if (logRequests) console.log(red(`Warning: Request logging is enabled! This will spam your console!\nTo disable this, unset the 'LOG_REQUESTS' environment variable!`)); - + if (logRequests) + console.log( + red( + `Warning: Request logging is enabled! This will spam your console!\nTo disable this, unset the 'LOG_REQUESTS' environment variable!` + ) + ); + return super.start(); } -} \ No newline at end of file +} |