webserve-1.1.0 is not a library.
Visit the last successful build:
webserve-1.3.0
A blazing-fast static file and SPA Web server written in Rust, powered by warp. 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
The executable will be located in target/release/webserve.
You can also install it globally (requires Rust):
๐ Usage
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:
๐ป Injected Reload Script
When --watch is used, index.html is automatically injected with:
๐ Project Structure
webserve/
โโโ src/
โ โโโ main.rs # Web server logic
โโโ Cargo.toml # Dependencies
โโโ README.md
๐ License
MIT ยฉ Mark Wayne Menorca