// use actix_web::{get, web, HttpResponse, Result}; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize)] struct MyObj { name: String, } #[get("/a/{name}")] async fn index(obj: web::Path) -> Result { Ok(HttpResponse::Ok().json(MyObj { name: obj.name.to_string(), })) } #[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 } //