From 76000f8fa11dde2f67efdb22a87c4644ea49f9eb Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 30 Jan 2021 19:58:15 +0100 Subject: :sparkles: Util --- src/Server.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Server.ts') 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(); -- cgit 1.5.1