Axum is a Rust framework for HTTP server APIs on the Tokio async runtime. Its small, mostly macro-free core provides routing, request extractors, responses, and error handling without imposing a service architecture. It builds on Tower and hyper; deeper service customization calls for Tower knowledge. section 9.1 section 9.11
Start with `cargo add axum`, then add crates for the capabilities the service needs. A SQLite-backed API can combine SQLx for persistence, Serde for serialization, and `tower-http` for tracing and CORS. Rust’s type checking helps catch mistakes when these components are assembled. section 9.4
Declare API routes
Use `Router::new()` to associate paths and HTTP methods with handlers: ```rust Router::new() .route("/alive", get(|| async { "ok" })) .route("/ready", get(ping)) .nest( "/v1", Router::new() .route("/todos", get(todo_list).post(todo_create)) .route( "/todos/:id", get(todo_read).put(todo_update).delete(todo_delete), ), ) ``` The router can also receive handler state and layers such as tracing and CORS. Keep route declarations aligned with the API design; consult Axum’s documentation for features beyond this basic pattern. section 9.7
Table 9.3 API service dependencies (view table figure)
The dependency table identifies which capabilities come from Axum and which require companion crates and features. section 9.4
Use Axum for the server-facing HTTP API rather than working directly with hyper’s lower-level server interface. Add tracing and metrics for production needs, and choose data modeling, state management, and response formats explicitly: the framework does not make those design decisions for you. section 10.8 section 9.11

