Преглед на файлове

add rate limit settings for dev

Yuki Takei преди 1 година
родител
ревизия
49ced04fd4
променени са 1 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 10 0
      apps/app/src/features/rate-limiter/config/index.ts

+ 10 - 0
apps/app/src/features/rate-limiter/config/index.ts

@@ -58,8 +58,18 @@ export const defaultConfig: IApiRateLimitEndpointMap = {
   },
 };
 
+const isDev = process.env.NODE_ENV === 'development';
+const defaultConfigWithRegExpForDev = isDev ? {
+  '/__nextjs_original-stack-frame': {
+    method: 'GET',
+    maxRequests: Infinity,
+  },
+} : {};
+
 // default config with reg exp
 export const defaultConfigWithRegExp = {
+  ...defaultConfigWithRegExpForDev,
+
   '/forgot-password/.*': {
     method: 'ALL',
     maxRequests: MAX_REQUESTS_TIER_1,