hyper-express-rate-limit
v7.1.5
Published
Basic IP rate-limiting middleware for Hyper-express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.
Downloads
14
Maintainers
Readme
Basic rate-limiting middleware for Hyper-express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.
Usage
import { rateLimit } from 'hyper-express-rate-limit'
const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
limit: 100, // Limit each IP to 100 requests per `window` (here, per 15 minutes).
standardHeaders: 'draft-7', // draft-6: `RateLimit-*` headers; draft-7: combined `RateLimit` header
legacyHeaders: false, // Disable the `X-RateLimit-*` headers.
// store: ... , // Use an external store for consistency across multiple server instances.
})
// Apply the rate limiting middleware to all requests.
app.use(limiter)
Issues and Contributing
If you encounter a bug or want to see something added/changed, please go ahead and open an issue! If you need help with something, feel free to start a discussion!
Credit
This repository is clone 99.99% from express-rate-limit
Thanks to Nathan Friedly, Vedant K
License
MIT © ThinhVu