Expand description
Static-file actix handler for dev servers.
Serves files from a single output directory with:
basePathsegment-aware stripping (so/webui-evil/xdoes not match/webui/),- traversal-safe path resolution,
<base href>-aware redirects (/foo→/foo/for directory URLs),- automatic livereload script injection into HTML responses,
- caller-controlled 404 strategy (plain text, custom file, etc.).
webui-cli does NOT use this handler — its serve command renders
requests on the fly via the WebUI handler. webui-press uses it to
serve the prebuilt out_dir.
Structs§
- Static
Serve Config - Configuration for
serve_static_file. Cheap to clone — paths are shared across requests.
Enums§
- NotFound
Strategy - What to serve when a requested file isn’t found.
Functions§
- serve_
file_ response - Build a 200 response for a successfully-read file, injecting the livereload script into HTML payloads. Public so callers with custom routing can serve files using the same headers/injection policy.
- serve_
static_ file - Serve
reqfromcfg, returning the appropriateHttpResponse.