#file-server #http-file-server #cli #static

app zserv

A simple, lightweight, and modern HTTP file server

2 releases

Uses new Rust 2024

0.1.1 Feb 16, 2026
0.1.0 Feb 16, 2026

#276 in HTTP server

MIT license

26KB
505 lines

zserv

Crates.io npm License

A simple, lightweight, and modern HTTP file server written in Rust.

zserv is designed to be a fast and easy way to serve static files from any directory. It's perfect for development, testing, or sharing files on a local network.

Features

  • 🚀 Fast & Lightweight: Built with Rust and Axum for high performance.
  • 📂 Directory Listing: Beautiful HTML directory listing with file icons and sizes.
  • 🌐 Modern: Supports HTTP/2.
  • 🔧 Configurable: Easy CLI options for port, binding address, and CORS.
  • 🔇 Quiet Mode: Suppress logs with a simple flag.
  • 📦 Cross-Platform: Binaries available for Linux, macOS, and Windows.

Quick Start

# Using npx (no installation required)
npx zserv

# Using bunx (no installation required)
bunx zserv

# Using cargo
cargo install zserv
zserv

Installation

The easiest way to run zserv without installing anything permanently:

# Using npx (Node.js)
npx zserv

# Using bunx (Bun)
bunx zserv

Or install globally:

# NPM
npm install -g zserv

# Bun
bun install -g zserv

With Cargo

cargo install zserv

From Binary

Download the latest pre-built binary for your operating system from the Releases page.

For Developers

If you want to contribute or run from source without installing:

git clone https://github.com/rinx-dev/zserv.git
cd zserv
cargo run

Usage

Run zserv in the directory you want to serve, or specify a path:

# Serve current directory on port 8080
zserv

# Serve a specific directory
zserv ./public

# Specify a custom port
zserv -p 3000

# Enable CORS headers
zserv --cors

# Listen on localhost only
zserv -a 127.0.0.1

Options

Usage: zserv [OPTIONS] [PATH]

Arguments:
  [PATH]  Directory to serve [default: .]

Options:
  -p, --port <PORT>        Port to listen on [default: 8080]
  -a, --address <ADDRESS>  Address to bind to [default: 0.0.0.0]
      --cors               Enable CORS headers
  -s, --silent             Suppress log output
  -h, --help               Print help
  -V, --version            Print version

License

This project is licensed under the MIT License - see the LICENSE file for details.

Dependencies

~19–28MB
~430K SLoC