Skip to main content

static_handler

Function static_handler 

Source
pub async fn static_handler(
    __arg0: State<StaticHandlerState>,
    req: Request<Body>,
) -> Response<Body>
Expand description

The axum handler mounted at the static_url base. Resolves the request path (already stripped of the base prefix by the nested mount) per the dev/prod algorithm and serves the file via serve_file.

State carries the StaticRegistry, the resolved static_root (absolute or CWD-relative on-disk dir), and the dev flag captured at build time.