Added some API doc comments

This commit is contained in:
Dave
2026-02-16 16:55:59 +00:00
parent feb05dc8d0
commit dae772e619
3 changed files with 18 additions and 0 deletions

View File

@@ -47,17 +47,20 @@ fn serve_embedded(path: &str) -> Response {
}
}
/// Serve a single embedded asset from the `assets/` folder.
#[handler]
pub fn embedded_asset(Path(path): Path<String>) -> Response {
let asset_path = format!("assets/{path}");
serve_embedded(&asset_path)
}
/// Serve an embedded file by path (falls back to `index.html` for SPA routing).
#[handler]
pub fn embedded_file(Path(path): Path<String>) -> Response {
serve_embedded(&path)
}
/// Serve the embedded SPA entrypoint.
#[handler]
pub fn embedded_index() -> Response {
serve_embedded("index.html")