Skip to content

Commit

Permalink
Merge pull request #1287 from animir/patch-4
Browse files Browse the repository at this point in the history
Update limitrequests.md
  • Loading branch information
goldbergyoni authored Mar 6, 2024
2 parents d330711 + 0a444a9 commit 54f8732
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sections/security/limitrequests.md
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 54f8732

Please sign in to comment.