Code Explainers

Code explainers tagged #tower

rust
use std::time::Duration;
 
use axum::{
    http::{header, HeaderValue, Request},

Serving fingerprinted assets in Axum

static-assets http-caching middleware
Intermediate 7 steps
rust
use std::time::Duration;
 
use axum::{
    body::Body,

Turning Axum timeouts into 504 JSON

middleware timeouts error-handling
Intermediate 7 steps
rust
use axum::{
    routing::get,
    Json, Router,
};

Response compression in Axum with tower-http

middleware compression http
Intermediate 6 steps
rust
use std::net::SocketAddr;
use std::time::Duration;
 
use axum::{routing::get, Json, Router};

Per-IP rate limiting in Axum with tower-governor

rate-limiting middleware tower
Intermediate 7 steps