use axum::{routing::get, Router};

#[tokio::main]
async fn main() {
    let app = Router::new().route(
        "/hello/:name",
        get(
            |axum::extract::Path(name): axum::extract::Path<String>| async move {
                format!("Hello, {name}!")
            },
        ),
    );

    let listener = tokio::net::TcpListener::bind("0.0.0.0:3081").await.unwrap();
    println!("Test server on :3081");
    axum::serve(listener, app).await.unwrap();
}
