Skip to main content

@rtorcato/api-rate-limit-hono v2.0.0

Functions​

rateLimitMiddleware()​

rateLimitMiddleware(options): MiddlewareHandler

Defined in: index.ts:14

Hono middleware that applies a sliding-window rate limit.

Keys on X-Forwarded-For → X-Real-IP → 'unknown'. Responds 429 with the standard error envelope { error: 'TooManyRequestsError', code: 'too_many_requests', message } from @rtorcato/api-errors, so clients parse it like any other error.

Parameters​

options​

RateLimiterOptions

Returns​

MiddlewareHandler