You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting this error when trying to set up a simple example with express-slowdown and rate-limit-redis. Here's the full example:
importexpressfrom'express';importRedisStorefrom'rate-limit-redis';importslowDownfrom'express-slow-down';import{createClient}from'redis';(async()=>{constclient=createClient();awaitclient.connect();constapp=express();constspeedLimiter=slowDown({windowMs: 30*1000,delayAfter: 1,delayMs: 500,store: newRedisStore({sendCommand: (...args)=>client.sendCommand(args),}),});app.use(speedLimiter);app.all('*',(req,res)=>{res.send('Hello');});app.listen(3000,()=>{console.log('Server listening on port 3000');});})();
Hey, I'm sorry about this, I think if you switch to rate-limit-redis@2.x it will work.
We upgraded the store interface in express-rate-limit, and rate-limit-redis@3.x is using the new interface (only). We're planning on upgrading express-slow-down to also be able to use the new interface, but no one has been able to get to it yet, so things are a bit messy right now.
This is now fixed properly with the release of express-slow-down v2.0.0 - the library was re-written to be a wrapper around express-rate-limit and thus now has full compatibility with express-rate-limit stores.
I'm getting this error when trying to set up a simple example with
express-slowdown
andrate-limit-redis
. Here's the full example:Versions of relevant packages:
express-slow-down@1.6.0
express@4.18.2
rate-limit-redis@3.0.2
redis@4.6.6
I'm assuming the error is on my end somewhere, but any help would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: