fix: get branch full working

This commit is contained in:
Rotimi Best
2025-11-25 17:18:15 +00:00
parent 8533e83f03
commit e0e3c8a01e
10 changed files with 396 additions and 327 deletions
+7
View File
@@ -8,6 +8,7 @@ import {
import type { MiddlewareHandler } from 'hono';
import { rateLimiter } from '@api/utils/redis/limiter';
import { userKeyGenerator } from '../utils/redis/key-generators';
import { env } from '@api/config/env';
export interface RateLimiterOptions {
windowMs?: number;
@@ -29,7 +30,13 @@ export const createRateLimiter = (options: RateLimiterOptions = {}): MiddlewareH
const opts = { ...defaultOptions, ...options };
return async (c, next) => {
// Skip rate limiting if not in production
if (env.NODE_ENV !== 'production') {
return await next();
}
try {
// Generate rate limit key
const key = opts.keyGenerator(c);