webserve 1.1.3

A lightweight web server
Documentation

webserve

Static file server for local development — SPA fallback, optional live reload, configurable host and port.

Rust · Actix Web · Tokio

GitHub stars GitHub forks GitHub issues License Crates.io

Repository · Issues · Pull requests


Features

Capability Description
Static hosting Serve any folder; optional directory listing when no index.html is present
SPA mode --spa — unknown paths serve index.html (client-side routing)
Live reload --watch — filesystem watcher + injected reload script for HTML
Binding Configurable --host and --port (defaults: 127.0.0.1, 8080)

Requirements

  • Rust (stable), e.g. via rustup

Installation

From a clone

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

Binary: target/release/webserve (or webserve.exe on Windows).

Install into Cargo bin path

cargo install --path .

Usage

webserve [OPTIONS]

Run webserve --help for the full option list.

Options

Option Short Description Default
--dir -d Root directory to serve Current working directory
--port -p TCP port 8080
--host -h Bind address 127.0.0.1
--spa SPA fallback to index.html off
--watch -w Watch files and reload browsers off

Examples

Serve the current directory:

webserve

Serve a production build with SPA and reload (typical for Vite/React/Vue dist):

webserve --dir ./dist --spa --watch

Listen on all interfaces (e.g. phone on same LAN):

webserve --host 0.0.0.0 --port 3000 --dir ./public

Development

cargo build
cargo test

License

MIT © Mark Wayne Menorca