Skip to main content

artifact_router

Function artifact_router 

Source
pub fn artifact_router(artifact: &Artifact, rendering: AxumService) -> Router
Expand description

A router that serves the artifact’s client assets and passes every other request to the application.

Assets answer GET and HEAD, from the artifact’s asset archive when it has one and from the client directory otherwise; other methods and missing paths reach rendering, so the framework handles its own routes, actions and 404 pages. Merge it into a router of Rust routes with Router::merge; it supplies the fallback.