rateLimitMiddleware(options: RateLimitOptions): MiddlewareFunction
Rate limiting middleware factory.
On each request, increments the counter for the resolved key. If count > max, short-circuits with a 429 response (Retry-After and RateLimit-* headers set, next() NOT called). Otherwise sets the headers and proceeds to next().
Registered globally — the usage below, and the one the README shows — the
limiter sees the operational probes too, so
RateLimitOptions.exclude exempts them by default. Widen or
narrow that list rather than dropping it: an exhausted bucket that refuses
/live gets the container restarted.
options: RateLimitOptions