From 8fdc8d06c05d3cd957b17755609db90d1123df31 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 9 Dec 2022 12:05:11 +0100 Subject: [PATCH] axum-server: Sync directory route and port with warp-server --- axum-server/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/axum-server/src/main.rs b/axum-server/src/main.rs index 02b4700..2a2eaaa 100644 --- a/axum-server/src/main.rs +++ b/axum-server/src/main.rs @@ -47,8 +47,8 @@ async fn main() { tracing_subscriber::fmt::init(); let app = Router::new() .route("/hello/:name", get(hello)) - .nest("/static", - get_service(tower_http::services::ServeDir::new(".").precompressed_gzip()) + .nest("/dir", + get_service(tower_http::services::ServeDir::new("../static").precompressed_gzip()) .handle_error(|e: io::Error| async move { (StatusCode::INTERNAL_SERVER_ERROR, format!("Unhandled internal error: {}", e)) }) @@ -62,7 +62,7 @@ async fn main() { ) ); - let addr = std::net::SocketAddr::from(([127, 0, 0, 1], 3000)); + let addr = std::net::SocketAddr::from(([127, 0, 0, 1], 3030)); tracing::info!("listening on {}", addr); axum::Server::bind(&addr) .serve(app.into_make_service()) -- 2.39.5