Skip to content

Novsochetra/live-server-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Live Server CLI

A lightweight, zero-configuration live-reloading development server written in Rust. Serve any folder over HTTP with automatic browser reload on file changes — perfect for HTML/CSS/JS development.

demo.mov

Features

  • 🚀 Instant Live Reload — automatically reloads the browser when files change.

  • 📂 Serve any directory — defaults to your current working directory; optionally specify a folder with --dir.

  • 🌐 WebSocket-based reload — injects a small script into HTML automatically.

  • ⚡ Fast and lightweight — built with Rust + Axum for high performance.

  • 🔄 Auto port fallback — detects if your desired port is in use and chooses a free one.

  • 🖥️ Open browser — optional --open flag to launch your browser automatically.

Installation

Live Server is written in Rust, so you'll need to grab a Rust installation in order to compile it. Live Server compiles with Rust 1.90.0 (1159e78c4 2025-09-14) (stable) or newer.

To build Live Server:

$ git clone https://github.com/novsochetra/live-server-rs
$ cd live-server-rs
$ cargo build --release
$ ./target/release/live-server --dir ./my-project

Usage

Serve the current directory on the default port (7878):

live-server

Specify a port and folder:

live-server --port 8080 --dir ./my-project

Automatically open the browser

live-server --open

Example Workflow

  1. Open a terminal and navigate to your project folder.
  2. Run:
live-server

Edit HTML, CSS, or JS files. Your browser will reload automatically when you save changes.

Why Rust?

  • 🚀 Blazing fast startup and runtime – perfect for small development tools like live servers.

  • 📦 Minimal dependencies – keeps the CLI lightweight and easy to distribute.

  • 🌐 Cross-platform support – works seamlessly on Linux, macOS, and Windows.

  • 🎓 A journey in learning Rust – building this live server is also a practical way to explore Rust’s async ecosystem, type safety, and performance-first mindset.

About

A lightweight, zero-configuration live-reloading development server written in Rust for HTML/CSS/JS development.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages