trillium-static 0.5.0

filesystem-backed static assets for trillium.rs
Documentation

📂 trillium-static — static file serving from the filesystem

ci crates.io version docs.rs

Serves static files directly from the filesystem. Supports index files, MIME type detection, and ETag-based caching. For embedding files into the binary at compile time, see trillium-static-compiled.

Note: This crate requires enabling a runtime feature: smol, tokio, or async-std.

Example

use trillium_static::{StaticFileHandler, crate_relative_path};

let handler = StaticFileHandler::new(crate_relative_path!("public"))
    .with_index_file("index.html");
// run with your chosen runtime adapter, e.g.:
// trillium_tokio::run(handler);

Safety

This crate uses #![forbid(unsafe_code)].

License