Skip to content

Commit

Permalink
config: Create rateLimiter config
Browse files Browse the repository at this point in the history
  • Loading branch information
bush1D3v committed Nov 9, 2024
1 parent 3d1c03b commit b9ae02f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/src/config/rateLimiter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import rateLimit from "express-rate-limit";

const rateLimiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100, // Limit each IP to 100 requests per `window` (here, per 15 minutes)
message: "Too many requests from this IP, please try again after 15 minutes",
headers: true,
});

export default rateLimiter;

0 comments on commit b9ae02f

Please sign in to comment.