Expand description
A web dev server with live reload. Usable as a CLI or as a library.
The HTTP server (Config, Server, bind, serve) is behind the
serve feature, enabled by default. Disable it to use only the watcher
(watch and ReloadType).
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§
- 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: