mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-10 20:02:26 +00:00
add rate limit and app name to env
This commit is contained in:
@@ -3,9 +3,10 @@ import createHttpError from "http-errors";
|
||||
import { NextFunction, Request, Response } from "express";
|
||||
import logger from "@server/logger";
|
||||
import HttpCode from "@server/types/HttpCode";
|
||||
import environment from "@server/environment";
|
||||
|
||||
const limit = 100;
|
||||
const minutes = 1;
|
||||
const limit = environment.RATE_LIMIT_MAX;
|
||||
const minutes = environment.RATE_LIMIT_WINDOW_MIN;
|
||||
|
||||
export const rateLimitMiddleware = rateLimit({
|
||||
windowMs: minutes * 60 * 1000,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NextFunction, Response, Request } from "express";
|
||||
import { NextFunction, Response } from "express";
|
||||
import ErrorResponse from "@server/types/ErrorResponse";
|
||||
import { unauthorized, verifySession } from "@server/auth";
|
||||
import { db } from "@server/db";
|
||||
|
||||
Reference in New Issue
Block a user