Skip to main content

@rtorcato/api-timeout-hono v0.1.0

Functions

timeoutMiddleware()

timeoutMiddleware(__namedParameters): MiddlewareHandler

Defined in: index.ts:16

Hono middleware that fails a request with 503 if downstream handlers don't finish within ms. Responds with the standard error envelope { error: 'ServiceUnavailableError', code: 'service_unavailable', message } from @rtorcato/api-errors. Non-timeout errors bubble up to Hono's onError unchanged.

ponytail: on timeout the downstream handler keeps running in the background (JS has no cancellation); its response is discarded.

Parameters

__namedParameters

TimeoutOptions

Returns

MiddlewareHandler