// use actix_web::{get, web, Result}; /// extract path info from "/users/{user_id}/{friend}" url /// {user_id} - deserializes to a u32 /// {friend} - deserializes to a String #[get("/users/{user_id}/{friend}")] // <- define path parameters async fn index(path: web::Path<(u32, String)>) -> Result { let (user_id, friend) = path.into_inner(); Ok(format!("Welcome {}, user_id {}!", friend, user_id)) } #[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 } //