A lightweight ASGI framework and toolkit for building async web services and APIs in Python.
tokio-rs/axum
An ergonomic, modular HTTP routing and request-handling library for Rust, built on tower and hyper.
- Stars
- 27,588
- Forks
- 1,526
- Open issues
- 109
- Last commit
- 5 days ago
What is it?
axum is a Rust library for building HTTP servers. It maps routes to async handler functions without macros, and handlers declare what they need from a request through extractors, such as parsed JSON bodies, so parsing and validation stay declarative. Handlers return anything that implements the response trait, which keeps error handling and response generation predictable.
Rather than defining its own middleware system, axum builds on tower::Service. Timeouts, tracing, compression and authorization from the tower and tower-http ecosystem can be applied directly, and middleware can be shared with applications written on hyper or tonic. axum is a thin layer over hyper and adds little overhead on top of it.
The project is published on crates.io and currently has a 0.8.x release line, while the main branch is working toward 0.9 with breaking changes. It forbids unsafe code and targets a minimum supported Rust version of 1.80.
Key features
- 01Macro-free routing from paths to async handler functions.
- 02Declarative request parsing through extractors, including JSON bodies.
- 03Responses generated from ordinary return types with minimal boilerplate.
- 04Full compatibility with the tower middleware ecosystem.
- 05Thin layer over hyper with low overhead.
- 06Written entirely in safe Rust with unsafe code forbidden.
Use cases
- Building JSON REST APIs in Rust with typed request and response bodies.
- Adding shared middleware such as tracing, timeouts or compression to a Rust web service.
- Sharing middleware between a web API and services built on hyper or tonic.
Quick start
- 1
Add axum to a Rust project (the README gives no install command)
- 2
Copy the usage example from the README into src/main.rs
- 3
Browse the examples directory for more code samples
Things to know
- The main branch contains breaking changes ahead of 0.9, so use the 0.8.x branch for the released version.
- The minimum supported Rust version is 1.80.
In collections
Topics
FAQ
- What is axum?
- An ergonomic, modular HTTP routing and request-handling library for Rust, built on tower and hyper. axum is a Rust library for building HTTP servers. It maps routes to async handler functions without macros, and handlers declare what they need from a request through extractors, such as parsed JSON bodies, so parsing and validation stay declarative. Handlers return anything that implements the response trait, which keeps error handling and response generation predictable.
- Is axum free to use? What license does it have?
- axum is open source under the MIT license. Check the license terms before using it in commercial products.
- Is axum still maintained?
- Actively maintained. The last commit to axum was on Oct 20, 2026.
- What can I use axum for?
- Building JSON REST APIs in Rust with typed request and response bodies. Adding shared middleware such as tracing, timeouts or compression to a Rust web service. Sharing middleware between a web API and services built on hyper or tonic.
- How do I install axum?
- Add axum to a Rust project (the README gives no install command) Copy the usage example from the README into src/main.rs Browse the examples directory for more code samples
- Where can I get axum?
- The source code and installation instructions are on GitHub: https://github.com/tokio-rs/axum
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Vapor is an HTTP web framework for building websites, APIs and cloud services in Swift.
Fast, unopinionated, minimalist web framework for Node.js for building web apps and HTTP APIs.
A PHP component that matches incoming HTTP request URLs to route configurations and generates URLs from named routes.
A Python web framework for building APIs with standard type hints, offering automatic validation, OpenAPI docs and high performance.
Asynchronous Kotlin framework for building microservices, web applications and HTTP APIs, developed by JetBrains.