summary refs log tree commit diff
path: root/src/Server.ts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Server.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Server.ts b/src/Server.ts

index 631ddeee..ba829eaa 100644 --- a/src/Server.ts +++ b/src/Server.ts
@@ -1,5 +1,8 @@ import fs from "fs/promises"; import { Server, ServerOptions } from "lambert-server"; +import { Authentication, GlobalRateLimit } from "./middlewares/"; +import Config from "./util/Config"; +import db from "./util/Database"; export interface DiscordServerOptions extends ServerOptions {} @@ -19,6 +22,13 @@ export class DiscordServer extends Server { } async start() { + await db.init(); + console.log("[DB] connected"); + await Promise.all([Config.init()]); + + this.app.use(GlobalRateLimit); + this.app.use(Authentication); + // recursively loads files in routes/ this.routes = await this.registerRoutes(__dirname + "/routes/"); // const indexHTML = await (await fetch("https://discord.com/app")).buffer();