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))
})
)
);
- 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())