⚡ Bolt-Web
A high-performance, minimalist web framework for Rust — inspired by Express.js and Gin.
Bolt is a lightweight, modular, and fully asynchronous web framework built on top of
hyper and tokio.
Its goal is performance, simplicity, and control — perfect for REST APIs, microservices, and backend systems.
🚀 Features
- 🌐 HTTP/1.x & HTTP/2 Support — Built-in protocol selection.
- 🚦 Fast Router — Path params, wildcards, and deterministic matching.
- 🧩 Middleware System — CORS, Helmet, Logging, Rate-Limiting, and more.
- 🔄 Async-First — Everything is async, from routing to middleware.
- 👥 Route Groups — Clean organization for large APIs.
- 🔒 Security Built-in — Panic protection, timeouts, connection limits, header/body limits.
- 🌐 Minimal HTTP Client — Useful for internal service calls.
📦 Dependencies
[]
= "0.3"
= { = "1.0", = ["derive"] }
= "1"
🦀 Basic Example
use json;
use ;
async
async
🧭 Routing
Bolt offers a clean and expressive routing system.
Route macros like Get!, Post!, Put!, etc., automatically generate handler types.
Basic route
Get!;
async
Path Parameters
Get!;
async
Wildcard
Get!;
Query Parameters
let page = req.query_param.unwrap_or;
🗂 Route Groups
let mut api = app.group;
api.get;
api.post;
let mut v1 = api.group;
v1.get;
Groups make large APIs clean and maintainable.
🔧 Middleware
Middleware can run before handlers and can short-circuit responses.
async
Middleware!;
🍪 Cookies
Bolt uses the cookie crate to generate RFC-compliant cookies.
res.cookie;
🌐 HTTP Client
Bolt includes a minimal async HTTP client for external APIs.
use Client;
let client = new;
let joke: Joke = client.get.await?;
🛡 Security
Bolt includes multiple production-grade protections:
- Panic isolation
- Request timeout
- Read timeout (Slowloris protection)
- Header limits
- Body size limits
- Connection limits
- Graceful shutdown
- TLS support
🧠 License
MIT © 2025 — Built with ❤️ in Rust.