main.rs
This file
Path
examples/customize-extractor-error/src/main.rs
36 lines · 1.1 KiB · Rust
Last changed by
Fix return types of serve futures (#3601)Jonas Plattebefore adoptionf3a95d7
History of this fileTake it
The walk stopped after 200 commits: lines older than dcbcf5c point at it.
axum-extra: Make typed-routing feature enable routing feature (#3514)tottotobefore adoptiondcbcf5c
lines 1–34why, one step back1//! Run with2//!3//! ```not_rust4//! cargo run -p example-customize-extractor-error5//! ```67mod custom_extractor;8mod derive_from_request;9mod with_rejection;1011use axum::{routing::post, Router};12use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};1314#[tokio::main]15async fn main() {16 tracing_subscriber::registry()17 .with(18 tracing_subscriber::EnvFilter::try_from_default_env()19 .unwrap_or_else(|_| format!("{}=trace", env!("CARGO_CRATE_NAME")).into()),20 )21 .with(tracing_subscriber::fmt::layer())22 .init();2324 // Build our application with some routes25 let app = Router::new()26 .route("/with-rejection", post(with_rejection::handler))27 .route("/custom-extractor", post(custom_extractor::handler))28 .route("/derive-from-request", post(derive_from_request::handler));2930 // Run our application31 let listener = tokio::net::TcpListener::bind("127.0.0.1:3000")32 .await33 .unwrap();34 tracing::debug!("listening on {}", listener.local_addr().unwrap());Fix return types of serve futures (#3601)Jonas Plattebefore adoptionf3a95d7
line 35why, one step back35 axum::serve(listener, app).await;axum-extra: Make typed-routing feature enable routing feature (#3514)tottotobefore adoptiondcbcf5c
line 36why, one step back36}