axum is a web application framework that focuses on ergonomics and modularity.
More information about this crate can be found in the crate documentation.
High level features
- Route requests to handlers with a macro free API.
- Declaratively parse requests using extractors.
- Simple and predictable error handling model.
- Generate responses with minimal boilerplate.
- Take full advantage of the
tower-httpecosystem of middleware, services, and utilities.
In particular the last point is what sets
axum apart from other frameworks.
axum doesn't have its own middleware system but instead uses
tower::Service. This means
axum gets timeouts, tracing, compression,
authorization, and more, for free. It also enables you to share middleware with
applications written using
use ; use ; use SocketAddr; async // basic handler that responds with a static string async async // the input to our `create_user` handler // the output to our `create_user` handler
You can find this example as well as other example projects in the example directory.
See the crate documentation for way more examples.
axum is a relatively thin layer on top of
hyper and adds very little
axum's performance is comparable to
hyper. You can find
benchmarks here and
This crate uses
#![forbid(unsafe_code)] to ensure everything is implemented in
100% safe Rust.
Minimum supported Rust version
axum's MSRV is 1.56.
The examples folder contains various examples of how to use
docs also provide lots of code snippets and examples. For full-fledged examples, check out community-maintained showcases or tutorials.
axum's repo we also have a number of examples showing how
to put everything together. Community-maintained showcases and tutorials also demonstrate how to use
axum for real-world applications. You're also welcome to ask in the Discord channel or open an issue with your question.
See here for a list of community maintained crates and projects
:balloon: Thanks for your help improving the project! We are so happy to have
you! We have a contributing guide to help you get involved in the
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in
axum by you, shall be licensed as MIT, without any
additional terms or conditions.