boltse
A high-signal, lightweight HTTP static file server written in Rust.
boltse is a minimal, zero-config utility designed for developers who need a reliable way to serve local directories over HTTP. It focuses on simplicity, fast startup, and a clean, directory-indexed web interface.
🚀 Quick Start
Installation
Install directly via cargo:
CLI Usage
Run the server in your current directory (defaults to 127.0.0.1:8080):
Customise host, port, and path using flags:
📦 Use as a Library
boltse is structured as a library crate, allowing you to embed a file server directly into your own Rust applications.
Implementation Example
Add boltse to your Cargo.toml and call the public serve function:
use boltse;
API Reference
serve(host: &str, port: &str, root_dir: &str): The primary entry point that binds the TCP listener and begins handling incoming requests.
✨ Features
- Zero Configuration: Smart defaults for local development.
- Automatic Indexing: Generates a clean, navigable HTML index for directories without an
index.html. - Path Decoding: Full support for URL-encoded characters in filenames.
- Informative Logging: Real-time feedback on requests and server status.
- Type Inference: Automatically maps common file extensions to correct MIME types (HTML, CSS, JS, WebP, WASM, and more).
🛠 Configuration Options
| Flag | Description | Default |
|---|---|---|
--host |
IP address or domain to bind to | 127.0.0.1 |
--port |
Port number to listen on | 8080 |
--path |
The root directory to serve | . |
⚖️ License
This project is licensed under the MIT License. See the LICENSE file for details.
Built with simplicity in mind by Jonas.