Skip to main content

wrap

Function wrap 

Source
pub fn wrap(app: Router) -> Router
Expand description

Wrap a caller’s Router with the standard mesofact middleware stack — /__mesofact/health, the tower-http trace layer, and nothing else magical. The caller keeps full control of the route table; this just adds the conventions every mesofact service is expected to satisfy.

Constraint: the caller’s router must NOT already register HEALTH_PATH — axum::Router::merge panics on overlapping method routes regardless of merge order. A service that wants a richer probe should bypass wrap and compose serve_app’s pieces manually.