Created
September 9, 2021 10:33
-
-
Save tsh-code/47837320a23adfae43705911744049c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rateLimit from "express-rate-limit"; | |
const limiter = rateLimit({ | |
windowMs: 15 * 60 * 1000, // 15 minutes | |
max: 100 // limit each IP to 100 requests per windowMs | |
}); | |
// apply rate limiter | |
app.use(limiter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment