Hi all! I'd like to share my first published crate, live-serve: a static dev server with live reload, in one binary of about 3 MB.

I used VS Code's Live Server for years and wanted the same workflow in Zed and from the terminal, without installing Node. live-serve is built on axum, notify and rustls.

demo

What it does:

  • live reload; saving a stylesheet swaps it in place without a full reload, even when your editor saves through a temporary file
  • waits until the page actually works before reloading, so a half-finished build never shows a 404
  • --poll for WSL, Docker volumes and network drives
  • safe defaults: binds 127.0.0.1, refuses unknown Host headers (DNS rebinding), hides dotfiles, and the reload WebSocket refuses other origins
  • HTTPS: --https for a self-signed certificate, or --cert/--key from mkcert (handy for testing on a phone over Wi-Fi)
  • --proxy /api=http://localhost:3000 to call a local backend without CORS
  • live-serve init vscode|zed writes the editor task, and there is a small VS Code extension with a Go Live button (the .vsix files are on the release page)

Install: cargo binstall live-serve, cargo install live-serve, brew install nguyentruong354/tap/live-serve, or Scoop (see the README).

Feedback on the code is very welcome, especially on the file watching and debouncing in src/lib.rs.

3 posts - 2 participants

Read full topic