From a093c7830d3d2a41a748cdff2e480b05f73642a6 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 23 Dec 2023 13:39:28 +0100 Subject: [PATCH] feat: update axum Signed-off-by: kjuulh --- rust-service/Cargo.toml | 8 ++++---- rust-service/crates/%%name%%/src/main.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rust-service/Cargo.toml b/rust-service/Cargo.toml index a4ef3a5..766e9fe 100644 --- a/rust-service/Cargo.toml +++ b/rust-service/Cargo.toml @@ -5,10 +5,10 @@ resolver = "2" [workspace.dependencies] %%name%% = { path = "crates/%%name%%" } -anyhow = { version = "1.0.71" } +anyhow = { version = "1" } tokio = { version = "1", features = ["full"] } tracing = { version = "0.1", features = ["log"] } tracing-subscriber = { version = "0.3.17" } -clap = { version = "4.3.4", features = ["derive", "env"] } -dotenv = { version = "0.15.0" } -axum = { version = "0.6.18" } +clap = { version = "4", features = ["derive", "env"] } +dotenv = { version = "0.15" } +axum = { version = "0.7" } diff --git a/rust-service/crates/%%name%%/src/main.rs b/rust-service/crates/%%name%%/src/main.rs index ac46a7b..7183189 100644 --- a/rust-service/crates/%%name%%/src/main.rs +++ b/rust-service/crates/%%name%%/src/main.rs @@ -33,8 +33,8 @@ async fn main() -> anyhow::Result<()> { let app = Router::new().route("/", get(root)); tracing::info!("listening on {}", host); - axum::Server::bind(&host) - .serve(app.into_make_service()) + let listener = tokio::net::TcpListener::bind(host).await.unwrap(); + axum::serve(listener, app.into_make_service()) .await .unwrap(); }