Skip to content

Commit

Permalink
refactor(NEXT): some routes skip for rate-limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
arg0WAK committed Jun 8, 2024
1 parent d3f14fd commit 1417101
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion middleware/ratelimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ const limiter = rateLimit({
error: "Too many requests, please try again later.",
});
},
skip: (req) => req.originalUrl === "/any",
skip: (req) => {
const skipUrls = ["/any", "/health", "/docs"];
return skipUrls.some((url) => req.originalUrl === url);
},
});

export default limiter;

0 comments on commit 1417101

Please sign in to comment.