소스 검색

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,