Salvo is a Rust HTTP framework with tree routing, middleware as handlers, and built-in OpenAPI and TLS helpers.
Overview
Salvo is a Rust web framework aimed at small handler functions with tree-based routes and middleware attached at any branch. It builds on Hyper and Tokio for async I/O and advertises HTTP/1, HTTP/2, and HTTP/3 support.
Handlers deserialize request bodies and return typed JSON when Serde derives are enabled. Changing a handler attribute to an endpoint macro enables OpenAPI documentation generation from the same code. Middleware uses the same handler model rather than a separate trait hierarchy.
TLS can be automated through ACME integration with Let's Encrypt. The framework also includes WebSocket and WebTransport support, multipart handling, and flexible parsing utilities described on the project site.
New projects are created with Cargo, a short main.rs handler, and cargo run. Official examples cover mTLS, MCP servers via Tower compatibility, and additional feature-specific crates in the ecosystem.
Key features
- Tree routing with nested middleware
- HTTP/1, HTTP/2, and HTTP/3
- OpenAPI via endpoint macro
- ACME automatic TLS
- WebSocket and WebTransport
- JSON request and response typing
- Built on Hyper and Tokio
- CLI tooling for project setup
Use cases
- JSON REST services in Rust
- Documented APIs with OpenAPI
- HTTPS sites with Let's Encrypt
- Real-time WebSocket endpoints