From ea888a84bac62519bbaa66ee18573b1350bc8c1a Mon Sep 17 00:00:00 2001 From: Michal Vanko Date: Wed, 18 Sep 2024 15:59:20 +0200 Subject: [PATCH] fix code --- axum_server/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/axum_server/src/main.rs b/axum_server/src/main.rs index 764f4c3..3f41ee8 100644 --- a/axum_server/src/main.rs +++ b/axum_server/src/main.rs @@ -1,6 +1,7 @@ use axum::{self}; use tower_http::services::ServeDir; use tower_livereload::LiveReloadLayer; +use tracing::info; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; mod blog_posts; @@ -45,8 +46,8 @@ async fn main() { // run our app with hyper, listening globally on port 3080 let port = std::option_env!("PORT").unwrap_or("3080"); let addr = format!("0.0.0.0:{}", port); - let listener = tokio::net::TcpListener::bind(addr).await.unwrap(); - info!("axum_server listening on http://{}", addr); + let listener = tokio::net::TcpListener::bind(&addr).await.unwrap(); + info!("axum_server listening on http://{}", &addr); axum::serve(listener, app).await.unwrap(); }