Skip to main content

router

Function router 

Source
pub fn router(
    controller: Arc<RuntimeApiController>,
    max_payload: usize,
) -> Router
Expand description

Build the axum router with all middleware applied. Exposed for use in integration tests (callers can wrap it in axum::serve against any tokio::net::UnixListener).

Middleware order (innermost first): handler → response-header Server → request-body cap → tracing span. Per 20-firecracker-api.md § 2, each request gets an info-level tracing span carrying instance_id, method, and the matched path pattern (not the raw URI — pattern names avoid PII like a drive_id in path).