> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/tokio-rs/axum/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction to Axum

> A modern, ergonomic web framework for Rust built on top of Tokio, Tower, and Hyper

Axum is an HTTP routing and request-handling library that focuses on ergonomics and modularity. Built by the Tokio team, it provides a macro-free API for building web services with Rust.

## Why Axum?

Axum stands out from other Rust web frameworks by leveraging the Tower ecosystem, giving you access to a rich set of middleware and utilities out of the box.

<CardGroup cols={2}>
  <Card title="Ergonomic routing" icon="route">
    Route requests to handlers with a clean, macro-free API that feels natural and intuitive.
  </Card>

  <Card title="Powerful extractors" icon="filter">
    Declaratively parse requests using type-safe extractors that handle validation automatically.
  </Card>

  <Card title="Tower ecosystem" icon="layer-group">
    Take full advantage of Tower and tower-http middleware for timeouts, tracing, compression, and more.
  </Card>

  <Card title="Type-safe responses" icon="check-circle">
    Generate responses with minimal boilerplate while maintaining compile-time guarantees.
  </Card>
</CardGroup>

## Key features

### Macro-free API

Unlike some Rust web frameworks, Axum doesn't rely on procedural macros for routing. This means faster compile times and clearer error messages.

```rust theme={null}
let app = Router::new()
    .route("/", get(root))
    .route("/users", post(create_user));
```

### Built on industry standards

Axum is built on top of battle-tested libraries:

* **Tokio** - Async runtime for handling concurrent connections
* **Hyper** - Fast HTTP implementation
* **Tower** - Modular service abstraction for middleware

<Note>
  Axum uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% safe Rust.
</Note>

### Simple error handling

Axum provides a predictable error handling model. Handlers can return `Result` types, and you have full control over error responses.

```rust theme={null}
async fn handler() -> Result<Json<User>, StatusCode> {
    let user = fetch_user().await
        .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
    Ok(Json(user))
}
```

## Performance

Axum is a relatively thin layer on top of Hyper and adds very little overhead. This means Axum's performance is comparable to Hyper itself, making it one of the fastest web frameworks available in any language.

<Info>
  Axum achieves excellent performance while maintaining ergonomics - you don't have to choose between speed and developer experience.
</Info>

## Tower middleware

What sets Axum apart is its integration with the Tower ecosystem. Instead of building its own middleware system, Axum uses `tower::Service`, which means:

* Share middleware with applications using Hyper or Tonic
* Access to timeouts, tracing, compression, authorization, and more for free
* Compose services in powerful ways using Tower's abstractions

```rust theme={null}
use tower_http::{compression::CompressionLayer, trace::TraceLayer};

let app = Router::new()
    .route("/", get(handler))
    .layer(CompressionLayer::new())
    .layer(TraceLayer::new_for_http());
```

## Minimum supported Rust version

Axum's MSRV is **1.80**.

## Next steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/installation">
    Set up Axum in your Rust project
  </Card>

  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Build your first HTTP server in minutes
  </Card>

  <Card title="Examples" icon="code" href="https://github.com/tokio-rs/axum/tree/main/examples">
    Explore real-world examples
  </Card>

  <Card title="API Documentation" icon="book" href="https://docs.rs/axum">
    Browse the complete API reference
  </Card>
</CardGroup>
