mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-24 10:04:03 +02:00
fix: improve error message when too many requests are sent
This commit is contained in:
@@ -69,6 +69,9 @@ export default async function start() {
|
|||||||
max: config.RATE_LIMIT, // limit each IP
|
max: config.RATE_LIMIT, // limit each IP
|
||||||
standardHeaders: true,
|
standardHeaders: true,
|
||||||
legacyHeaders: false,
|
legacyHeaders: false,
|
||||||
|
message: (request: express.Request, response: express.Response) => {
|
||||||
|
return `You can only make ${config.RATE_LIMIT} requests every 15min.`;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const speedLimiter = slowDown({
|
const speedLimiter = slowDown({
|
||||||
windowMs: 15 * 60 * 1000, // 15 minutes
|
windowMs: 15 * 60 * 1000, // 15 minutes
|
||||||
|
|||||||
Reference in New Issue
Block a user