A poc for implementation of "Sliding Window Counter" algorithm for limiting API calls in nodeJS using "express-rate-limit" and redis
- Clone this repository
- npm i --save
- Install Redis(https://redis.io/download) on your system
- Start Redis server
- Set WINDOW_SIZE_IN_HOURS to the number of hours of the window, MAX_WINDOW_REQUEST_COUNT as the max number of api calls within WINDOW_SIZE_IN_HOURS duration in the file app/modules/books/middleware/rateLimiter.js
- Start node server
- In Postman, fire a GET API to 'http://localhost:8080/api/booksAPI/books_routes/books' and check the results.