summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-05 17:47:44 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-05 17:47:44 +0100
commitc53d6628f74d59e40325fcb2efb96d785452768e (patch)
treec4fb6d1d045919135d39acb329a4e7f5170afed8
parentMerge branch 'master' of https://github.com/discord-open-source/discord-api i... (diff)
downloadserver-c53d6628f74d59e40325fcb2efb96d785452768e.tar.xz
use discord-server-util
-rw-r--r--src/Server.ts2
-rw-r--r--src/middlewares/GlobalRateLimit.ts2
-rw-r--r--src/middlewares/RateLimit.ts3
3 files changed, 4 insertions, 3 deletions
diff --git a/src/Server.ts b/src/Server.ts

index 729531ef..4d949353 100644 --- a/src/Server.ts +++ b/src/Server.ts
@@ -2,7 +2,7 @@ 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"; +import { db } from "discord-server-util"; import i18next from "i18next"; import i18nextMiddleware, { I18next } from "i18next-http-middleware"; import i18nextBackend from "i18next-node-fs-backend"; diff --git a/src/middlewares/GlobalRateLimit.ts b/src/middlewares/GlobalRateLimit.ts
index 8fbfbd5c..121616f8 100644 --- a/src/middlewares/GlobalRateLimit.ts +++ b/src/middlewares/GlobalRateLimit.ts
@@ -1,6 +1,6 @@ import { NextFunction, Request, Response } from "express"; import Config from "../util/Config"; -import db from "../util/Database"; +import { db } from "discord-server-util"; export async function GlobalRateLimit(req: Request, res: Response, next: NextFunction) { if (!Config.get().limits.rate.ip.enabled) return next(); diff --git a/src/middlewares/RateLimit.ts b/src/middlewares/RateLimit.ts
index 6c4a1080..33ae0cd5 100644 --- a/src/middlewares/RateLimit.ts +++ b/src/middlewares/RateLimit.ts
@@ -1,5 +1,6 @@ import { NextFunction, Request, Response } from "express"; -import db from "../util/Database"; +import { db } from "discord-server-util"; + import { getIpAdress } from "./GlobalRateLimit"; export function RateLimit({ count = 10, timespan = 1000 * 5, name = "/" }) {