Middleware
Tower layers.
What is middleware?
Middleware runs code before and after a handler, wrapping the request/response cycle. Use it for logging, auth, compression, and timeouts.
- Axum builds on the
towerecosystem - Middleware is added as layers
The Service trait
Tower defines a Service: something that takes a request and asynchronously produces a response. Layers wrap one service in another.
All lessons in this course
- Axum Routing
- Extractors
- JSON and State
- Middleware