--- /dev/null
+use axum::{
+ routing::{get},
+ extract::Path,
+ http,
+ response,
+ Router};
+
+async fn hello(Path(name): Path<String>) -> impl response::IntoResponse {
+ (http::StatusCode::OK, format!("Hello {}", name))
+}
+
+#[tokio::main]
+async fn main() {
+ tracing_subscriber::fmt::init();
+ let app = Router::new()
+ .route("/hello/:name", get(hello))
+ .layer(
+ tower::ServiceBuilder::new()
+ .layer(tower_http::trace::TraceLayer::new_for_http())
+ );
+
+ let addr = std::net::SocketAddr::from(([127, 0, 0, 1], 3000));
+ tracing::info!("listening on {}", addr);
+ axum::Server::bind(&addr)
+ .serve(app.into_make_service())
+ .await
+ .unwrap();
+}