webserve

Crates.iowebserve
lib.rswebserve
version1.1.2
created_at2025-04-25 04:42:50.876334+00
updated_at2025-11-07 03:57:22.443698+00
descriptionA lightweight web server
homepage
repository
max_upload_size
id1648515
size73,417
Mark Wayne Menorca (marcuwynu23)

documentation

README

webserve

Stars Badge Forks Badge Issues Badge License Badge

A blazing-fast static file and SPA Web server written in Rust. Supports live reload, SPA fallback, and directory serving โ€” like npm serve, but compiled and production-ready.


๐Ÿš€ Features

  • โœ… Serve any directory (-d ./dist)
  • โœ… SPA fallback support (--spa)
  • โœ… File watching with automatic browser reload (--watch)
  • โœ… Configurable host and port (-h, -p)
  • โœ… Built with Rust + Tokio for high performance

๐Ÿ“ฆ Installation

git clone https://github.com/marcuwynu23/webserve
cd webserve
cargo build --release

The executable will be located in target/release/webserve.

You can also install it globally (requires Rust):

cargo install --path .

๐Ÿ›  Usage

webserve [OPTIONS]

Options

Flag Description Default
-d, --dir Directory to serve files from Current directory
-p, --port Port to listen on 8080
-h, --host Host/IP to bind 127.0.0.1
--spa Enable SPA fallback (404 โ†’ index.html) disabled
-w, --watch Enable file watching + auto-reload disabled

๐Ÿงช Example

Serve a Vite/React app from ./dist, with SPA fallback and live reload:

webserve -d ./dist --spa --watch

๐Ÿ“œ License

MIT ยฉ Mark Wayne Menorca

Commit count: 0

cargo fmt