summary refs log tree commit diff
path: root/src/Server.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-01-30 19:58:15 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-01-30 19:58:15 +0100
commit76000f8fa11dde2f67efdb22a87c4644ea49f9eb (patch)
tree67664d9c616068113b8fef6704b005726be8f0a7 /src/Server.ts
parent:sparkles: Database (diff)
downloadserver-76000f8fa11dde2f67efdb22a87c4644ea49f9eb.tar.xz
:sparkles: Util
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();