Expand description
A web dev server with live reload. Usable as a CLI or as a library.
Feature flags:
serve(default): server (Config,Server,bind,serve), watcher (watch,ReloadType) andbase_normalize.default-features = false: watcher (watch,ReloadType) andbase_normalize, without the server. Does not pull Axum as a dependency.
See the README for features, CLI, and library usage.
Structs§
- Config
- Configuration for the server
- Server
- A bound server, ready to run.
runstarts serving only when awaited, so theurlcan be shown first.
Enums§
- Reload
Type - How to reload a browser tab on file change
Functions§
- base_
normalize - Validate and normalize the
--baseurl path prefix: - bind
- Bind to
config.ip:config.portand build the router. Returns the url, the bound listener and the router. Use0asconfig.portto let the OS pick a free port (the real one is in the url). - serve
- Serve files from the already-bound
listenerwith the givenrouter, with live-reload over SSE. - watch
- Run a background thread and watch a directory. When files change: