A simple tool to serve static files from a directory
cargo install --git https://github.com/Lurk/serve serve
serve [OPTIONS] [PATH] [COMMAND]
Options:
-p, --port <PORT> port to listen on [default: 3000]
-a, --addr <ADDR> address to listen on [default: 127.0.0.1]
-l, --log-level <LOG_LEVEL> log level [default: error] [possible values: error, warn, info, debug, trace]
--disable-compression compression layer is enabled by default
--not-found <NOT_FOUND> path to 404 page. By default, 404 is empty
--ok override with 200 OK. Useful for SPA. Requires --not-found
-h, --help Print help
-V, --version Print version
[PATH] path to the directory to serve. Defaults to the current directory
tls Adds TLS support
help Print this message or the help of the given subcommand(s)
Adds TLS support
Usage: serve tls --cert <CERT> --key <KEY>
Options:
-c, --cert <CERT> path to the certificate file
-k, --key <KEY> path to the private key file
-h, --help Print help
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 \
-nodes -keyout localhost.key -out localhost.crt -subj "/CN=localhost" \
-addext "subjectAltName=IP:127.0.0.1"
serve MSRV is 1.74