From 6d4e0ca301c9b2b90ebc5651c5e99fed2e4c3e38 Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 12 Nov 2023 03:54:50 +1000 Subject: [PATCH] Update limitrequests.md Use ioredis package --- sections/security/limitrequests.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sections/security/limitrequests.md b/sections/security/limitrequests.md index 21482d050..0763a3b57 100644 --- a/sections/security/limitrequests.md +++ b/sections/security/limitrequests.md @@ -8,12 +8,10 @@ Rate limiting should be implemented in your application to protect a Node.js app ```javascript const http = require('http'); - const redis = require('redis'); + const IoRedis = require('ioredis'); const { RateLimiterRedis } = require('rate-limiter-flexible'); - const redisClient = redis.createClient({ - enable_offline_queue: false, - }); + const redisClient = new IoRedis({ enableOfflineQueue: false }); // Maximum 20 requests per second const rateLimiter = new RateLimiterRedis({