diff --git a/Cargo.toml b/Cargo.toml index e85e0d8..725b455 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,7 +74,7 @@ hex = { version = "0.4.3", optional = true } tokio = { version = "1.0", optional = true, features = ["macros", "rt-multi-thread"] } warp = { version = "0.3", default-features = false, optional = true } rocket = { version = "0.5.0-rc.2", default-features = false, optional = true } -axum = { version = "0.6", default-features = false, features = ["http1", "tokio"], optional = true } +axum = { version = "0.7", default-features = false, features = ["http1", "tokio"], optional = true } poem = { version = "1.3.30", default-features = false, features = ["server"], optional = true } salvo = { version = "0.16", default-features = false, optional = true } diff --git a/examples/axum.rs b/examples/axum.rs index 18b6c6b..b102eb0 100644 --- a/examples/axum.rs +++ b/examples/axum.rs @@ -18,7 +18,8 @@ async fn main() { // Start listening on the given address. let addr = SocketAddr::from(([127, 0, 0, 1], 3000)); println!("listening on {}", addr); - axum::Server::bind(&addr).serve(app.into_make_service()).await.unwrap(); + let listener = tokio::net::TcpListener::bind(addr).await.unwrap(); + axum::serve(listener, app.into_make_service()).await.unwrap(); } // We use static route matchers ("/" and "/index.html") to serve our home