@rtorcato/api-rate-limit-express v1.0.0
Functions
rateLimitMiddleware()
rateLimitMiddleware(
options):RequestHandler
Defined in: index.ts:14
Express middleware that applies a sliding-window rate limit.
Keys on the client IP extracted by getIP (respects X-Forwarded-For).
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
RequestHandler