The application currently lacks a rate-limiting middleware which could lead to server overload. Adding rate-limiter can help control the number of request a user can make in a given set of time improving the app's security and stability.
Proposed Solution:
npm install express-rate-limit
import rateLimit from 'express-rate-limit';
const limiter = rateLimit({
windowMs: 1 60 1000, // 1 minute
max: 100 // limit each IP to 100 requests per minute
});
The application currently lacks a rate-limiting middleware which could lead to server overload. Adding rate-limiter can help control the number of request a user can make in a given set of time improving the app's security and stability.
Proposed Solution:
npm install express-rate-limit
import rateLimit from 'express-rate-limit';
const limiter = rateLimit({ windowMs: 1 60 1000, // 1 minute max: 100 // limit each IP to 100 requests per minute });
app.use(limiter);