10 lines
281 B
JavaScript
10 lines
281 B
JavaScript
const rateLimit = require('express-rate-limit');
|
|
|
|
const limiter = rateLimit({
|
|
windowMs: 15 * 60 * 1000, // 15 minutes
|
|
max: 5, // limit each IP to 5 requests per windowMs
|
|
message: 'Too many login attempts from this IP, please try again later.',
|
|
});
|
|
|
|
module.exports = limiter;
|