mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 18:42:40 +00:00
5 requests
This commit is contained in:
@@ -28,7 +28,7 @@ const isStaticTheme = (renderer, themeName)=>{
|
|||||||
// Define rate limiter options
|
// Define rate limiter options
|
||||||
const rateLimiter = rateLimit({
|
const rateLimiter = rateLimit({
|
||||||
timeWindow : 5 * 60 * 1000, // 5 minutes window
|
timeWindow : 5 * 60 * 1000, // 5 minutes window
|
||||||
max : 60, // limit each IP to 100 requests per timeWindow
|
max : 5, // limit each IP to 100 requests per timeWindow
|
||||||
handler: (req, res, next) => {
|
handler: (req, res, next) => {
|
||||||
console.log(`Rate limiting user ${req.account?.username}`);
|
console.log(`Rate limiting user ${req.account?.username}`);
|
||||||
throw { HBErrorCode: '55', status: 429, message: 'Too many requests from this IP, please try again after 5 minutes'};
|
throw { HBErrorCode: '55', status: 429, message: 'Too many requests from this IP, please try again after 5 minutes'};
|
||||||
|
|||||||
Reference in New Issue
Block a user