Launch a local network server with live reload feature for static pages.
You can use it as a CLI program.
console
$ cargo install live-server
```console $ live-server --help live-server 0.6.0 Launch a local network server with live reload feature for static pages
USAGE: live-server [OPTIONS] [PATH]
ARGS:
OPTIONS:
-h, --host
You can set different RUST_LOG
environment variable to filter the log. The default log level is warn
. So if you want to get more detailed information, it is recommended to use:
console
$ RUST_LOG=debug,tide=warn live-server
[2023-02-17T09:18:56Z INFO live_server::server] Listening on http://192.168.0.166:8000/
[2023-02-17T09:18:56Z INFO live_server::watcher] Listening on /tmp/live_server_test/
[2023-02-17T09:19:06Z DEBUG live_server::watcher] [UPDATE] index.html
You can also import it as a library in your project.
rust
use live_server::listen;
listen("127.0.0.1", 8080, "./").await.unwrap();
rust
env_logger::init();