Expand description
§axum_static
Static file serving for Axum.
This crate provides utilities for serving static files with proper content-type inference.
§Features
handle_error: Enables error handling for IO errors when serving files.mime_guess: Uses themime_guesscrate for exhaustive MIME inference.status_code: Enhances error responses with human-readable status messages.
§Example
use axum_static::static_router;
let app = static_router("static/");Functions§
- content_
type_ middleware - Middleware that sets the
Content-Typeheader based on the file extension. - static_
router - Creates a router that serves static files from the given directory.