From 87a17016c8aea5e7b35d540b3b4ae98127e024d9 Mon Sep 17 00:00:00 2001 From: Anil Gulecha Date: Wed, 13 Nov 2024 15:08:59 +0530 Subject: [PATCH] Make ratelimit configurable by ENV variable. Make ratelimit configurable by ENV variable. --- src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index 981f5aa..cb8eb3f 100644 --- a/src/app.ts +++ b/src/app.ts @@ -23,7 +23,7 @@ const API_URL = process.env.LEETCODE_API_URL || 'https://leetcode.com/graphql'; const limiter = rateLimit({ windowMs: 60 * 60 * 1000, // 1 hour - limit: 60, + limit: (process.env.RATELIMIT && parseInt(process.env.RATELIMIT)) || 60, standardHeaders: 'draft-7', legacyHeaders: false, message: 'Too many request from this IP, try again in 1 hour',