0PricingLogin
Learn Rust Coding · Lesson

Axum Routing

Handlers and routes.

What is Axum?

Axum is an ergonomic, async web framework from the Tokio team. It builds on tower and hyper.

  • Handlers are plain async functions
  • Routing is type-driven and composable
  • Runs on the Tokio runtime

A handler is a function

An Axum handler is an async function that returns something convertible into a response, such as a &str or String.

async fn hello() -> &'static str {
    "Hello, world!"
}

All lessons in this course

  1. Axum Routing
  2. Extractors
  3. JSON and State
  4. Middleware
← Back to Learn Rust Coding