| Crates.io | web-dev-server |
| lib.rs | web-dev-server |
| version | 0.1.0 |
| created_at | 2025-10-22 06:26:14.386769+00 |
| updated_at | 2025-10-22 06:26:14.386769+00 |
| description | An very simple live reload server for frontend development |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1895072 |
| size | 122,272 |
Minimal Actix-based development server for static sites with smart live reloads. It watches a workspace folder, serves HTML/CSS/JS, and keeps your browser in sync using lightweight websocket events.
Warning: This is a self-use solution and is not suitable for production.
This project was almost developed using AI assistance.
/ _live/ws.<body> and linked CSS without full refreshes.--no-open-browser).rustup update stable).cargo run -- ./examples/site --port 4100
<path>: Directory containing index.html and assets (defaults to the repo root).--port <u16>: TCP port (defaults to 3000; if in use, the server auto-increments until it finds a free slot). The server binds to 127.0.0.1.--diff-mode: Switch to partial refreshes; HTML updates keep state intact when paths line up.--no-open-browser: Disable automatic browser launch for remote/CI runs.The watcher (via notify) broadcasts JSON events to the injected client script at /_live/script.js. When diff mode is off—or when a change cannot be classified—the client performs a full reload. HTML/CSS changes in diff mode trigger precise updates while preserving runtime state.
src/main.rs: CLI entry that parses flags and runs the server.src/startup.rs: Actix app assembly, watcher loop, and live reload messaging.src/internal_scope.rs: Internal / _live scope (health, websocket, injected script).src/js/script.js: Browser-side live reload client.cargo check: Fast compile-time validation before committing.cargo fmt: Enforce the Rust style guide.cargo test: Run unit tests (see src/startup.rs for examples).cargo build --release: Produce an optimized binary when packaging the tool.Follow the guidance in AGENTS.md for coding standards, commit expectations, and pull-request checklists. Open issues with reproduction steps to help triage watcher or websocket behaviour quickly.
Licensed under GPL-3.0.
You're allowed to use, modify, and distribute this software under the terms of
the GNU General Public License version 3.0 as published by the Free Software Foundation.
See the LICENSE file for details.