Namespace for the counter (e.g. "auth"), scoped per client.
The request context, forwarded to handlerFn.
Optional handlerFn: HandlerHandler to run when under the limit.
Maximum requests allowed within timeLapse.
Sliding window in milliseconds; defaults to one hour.
Response factory used when the limit is exceeded; defaults to res_429.
The handler's response, or the limit-reached response.
Generated using TypeDoc
Rate-limits a request by counting recent entries under a prefix in the
RateLimitDurable Object, then either invokes the handler or the limit-reached response. AppendsX-RateLimit-Limit/X-RateLimit-Remainingheaders. A no-op passthrough tohandlerFnwhen theRateLimitobject is not registered.