Skip to content

Commit 01f6854

Browse files
committed
added rate limitting
1 parent f4b01af commit 01f6854

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

api-gateway/src/middleware/security.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ export const applySecurityMiddleware = (app: Application) => {
2222
// Apply rate limiter if needed
2323
const limiter = rateLimit({
2424
windowMs: 15 * 60 * 1000, // 15 minutes
25-
max: 100
25+
max: 100,
26+
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
27+
legacyHeaders: false,
2628
});
29+
2730
app.use(limiter);
2831
};

0 commit comments

Comments
 (0)