Spaces:
Sleeping
Sleeping
| import rateLimit from 'express-rate-limit'; | |
| import { config } from '../config'; | |
| export const apiLimiter = rateLimit({ | |
| windowMs: config.rateLimit.windowMs, | |
| max: config.rateLimit.maxRequests, | |
| message: { error: 'Too many requests, please try again later' }, | |
| standardHeaders: true, | |
| legacyHeaders: false, | |
| }); | |
| export const authLimiter = rateLimit({ | |
| windowMs: 15 * 60 * 1000, | |
| max: 10, | |
| message: { error: 'Too many authentication attempts, please try again later' }, | |
| standardHeaders: true, | |
| legacyHeaders: false, | |
| }); | |