ecluse:ecluse-runtime
Safe HaskellNone
LanguageGHC2021

Ecluse.Runtime.Server.Middleware

Description

The front door's request timeout and its control-plane health probes, /livez and /readyz. The request-body cap is a route concern, enforced where the only body-consuming route (publish) reads its body.

Synopsis

The request timeout

requestTimeout :: Deadlines -> Int -> Middleware Source #

Answer an empty 503 for a request that outlives this many seconds, about one sweep late. Like wai-extra's timeout, it answers even when a response has already begun.

Control-plane health probes

probeApplication :: IO Readiness -> IO Liveness -> Application Source #

The control-plane health probes, answered above any mount: /livez and /readyz from the injected checks. Any other path is a 404.

Neutral response shapes

jsonResponse :: Status -> LByteString -> Response Source #

A JSON response with the given status and body, tagged application/json.