use awebframework::prelude::*; use http::StatusCode; use std::net::SocketAddr; #[tokio::main] async fn main() { tracing_subscriber::fmt::init(); // build our application with some routes let app = route("/", get(handler)).route("/greet/:name", get(greet)); // run it let addr = SocketAddr::from(([127, 0, 0, 1], 3000)); tracing::debug!("listening on {}", addr); app.serve(&addr).await.unwrap(); } async fn handler() -> response::Html<&'static str> { response::Html("