safely-flow-request
v1.1.0
Published
"a simple package to control on too many request from server so that it can flow safely and stable the backend side system"
Downloads
23
Readme
Rate Limiter
A simple npm package for API rate limiting based on IP addresses.
Installation
To install the package, run:
how to use this package in your project
const RateLimiter = require('rate-limiter');
const limiter = new RateLimiter({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100, // limit each IP to 100 requests per windowMs
});
// Apply the rate limiter to your API routes
app.use(limiter);