2.2.2 • Published 5 years ago

rate-limit-express v2.2.2

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

Rate limiting:

  • Rate limit middleware to limit access.
  • Everytime a user sends a request to the server, ipaddress of the user is the key and the number of times visited is increased by one.
  • This function also sets of a callback function which gets triggered after timelimit(second parameter) seconds and reduces the number of times visited by one.
  • So we effectively keep the ipaddress and number of requests in the last timelimit seconds window.
  • If it is greater than the requestlimits(firstparameter), we send an error message.

Usage:

  • const ratelimiter = require("rate-limit-express");
  • app.use(ratelimiter.ratelimit(5, 10));
  • app is your Express app and first parameter is timelimit and second parameter is access limit
2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.0.0

5 years ago