add rate limiting
This commit is contained in:
1 parent
051c17f454
commit
ec99b5e9b4
5 files changed
+60
-11
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import rateLimit from "express-rate-limit";
|
||||
|
||||
export const generalApiLimiter = rateLimit({
|
||||
window: 60 * 1000,
|
||||
limit: 600,
|
||||
standardHeaders: true,
|
||||
legacyHeaders: false,
|
||||
ipv6Subnet: 64,
|
||||
});
|
||||
|
||||
export const authApiLimiter = rateLimit({
|
||||
window: 60 * 1000,
|
||||
limit: 5,
|
||||
standardHeaders: true,
|
||||
legacyHeaders: false,
|
||||
ipv6Subnet: 64,
|
||||
});
|
||||
Reference in new issue
Block a user