remove the rate limiter
All checks were successful
Deploy Backend / deploy (push) Successful in 3m35s
All checks were successful
Deploy Backend / deploy (push) Successful in 3m35s
This commit is contained in:
parent
0317eae926
commit
6c8ef89bb5
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
@ -23,7 +23,6 @@
|
||||
"elysia-autoroutes": "^0.5.0",
|
||||
"elysia-decorators": "^1.0.2",
|
||||
"elysia-helmet": "^2.0.0",
|
||||
"elysia-rate-limit": "^4.1.0",
|
||||
"eslint": "^8.57.1",
|
||||
"extract-colors": "^4.1.0",
|
||||
"jimp": "^1.6.0",
|
||||
|
@ -3,8 +3,6 @@ import cors from "@elysiajs/cors";
|
||||
import { decorators } from "elysia-decorators";
|
||||
import { logger } from "@tqman/nice-logger";
|
||||
import { swagger } from "@elysiajs/swagger";
|
||||
import { rateLimit } from "elysia-rate-limit";
|
||||
import { RateLimitError } from "./error/rate-limit-error";
|
||||
import { helmet } from "elysia-helmet";
|
||||
import { etag } from "@bogeychan/elysia-etag";
|
||||
import AppController from "./controller/app.controller";
|
||||
@ -133,26 +131,6 @@ app.use(
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* Rate limit (100 requests per minute)
|
||||
*/
|
||||
app.use(
|
||||
rateLimit({
|
||||
scoping: "global",
|
||||
duration: 60 * 1000,
|
||||
max: 100,
|
||||
skip: request => {
|
||||
// Skip requests to /
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,prefer-const
|
||||
let [_, path] = request.url.split("/"); // Get the url parts
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
path === "" || (path === undefined && (path = "/")); // If we're on /, the path is undefined, so we set it to /
|
||||
return path === "/"; // ignore all requests to /
|
||||
},
|
||||
errorResponse: new RateLimitError("Too many requests, please try again later"),
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* Security settings
|
||||
*/
|
||||
|
Reference in New Issue
Block a user