Share your code.
Rate limiting middleware for Express applications built on redis
var express =var app =var client =var limitter = app clientapp
Stringroute path to the request
Stringhttp method. accepts
delete, and of course Express'
String|Array.<String>value lookup on the request object. Can be a single value or array. See examples for common usages
Numberallowed number of requests before getting rate limited
Numberamount of time in
msbefore the rate-limited is reset
function(req)optional param allowing the ability to whitelist. return
falseto passthru to limitter.
// limit by IP address// or if you are behind a trusted proxy (like nginx)// by user (assuming a user is logged in with a valid id)// limit your entire app// limit users on same IP// whitelist user amins
Happy Rate Limitting!