Skip to main content

serve_static_file

Function serve_static_file 

Source
pub async fn serve_static_file(
    req: &HttpRequest,
    cfg: &StaticServeConfig,
) -> HttpResponse
Expand description

Serve req from cfg, returning the appropriate HttpResponse.

This function is not an actix handler itself — it’s invoked by a caller’s default_service handler so the caller can attach app state, middleware, and additional routes around it.