We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f0b01d commit 8e97af5Copy full SHA for 8e97af5
src/server/middleware/rateLimit.ts
@@ -6,6 +6,10 @@ import { createCustomError } from "./error";
6
7
export const withRateLimit = async (server: FastifyInstance) => {
8
server.addHook("onRequest", async (request, reply) => {
9
+ if (request.url === "/" || request.url === "/json") {
10
+ return;
11
+ }
12
+
13
const epochTimeInMinutes = Math.floor(new Date().getTime() / (1000 * 60));
14
const key = `rate-limit:global:${epochTimeInMinutes}`;
15
const count = await redis.incr(key);
0 commit comments