webserve

Static file server for local development. Serve a directory over HTTP with optional SPA routing and live reload.

Install

cargo install webserve

Or build from source: cargo install --path .

Use

webserve
webserve --dir ./dist --spa --watch
webserve --open --port 8080

CLI

-d --dir Directory to serve (default: current)
-p --port Port (default: 8080)
-h --host Bind address (default: 127.0.0.1)
--spa Fallback to index.html for client routes
-w --watch Reload browser when files change
--open Open default browser after start

Stack

  • Rust · Actix Web · Tokio
  • Directory listing when no index is present
  • MIT licensed