// use actix_web::{get, web, Responder, Result}; use serde::Serialize; #[derive(Serialize)] struct MyObj { name: String, } #[get("/a/{name}")] async fn index(name: web::Path) -> Result { let obj = MyObj { name: name.to_string(), }; Ok(web::Json(obj)) } #[actix_web::main] async fn main() -> std::io::Result<()> { use actix_web::{App, HttpServer}; HttpServer::new(|| App::new().service(index)) .bind(("127.0.0.1", 8080))? .run() .await } //