use actix_web::{web, HttpRequest, Result}; // fn index(req: HttpRequest) -> Result { let name: String = req.match_info().get("friend").unwrap().parse().unwrap(); let userid: i32 = req.match_info().query("userid").parse().unwrap(); Ok(format!("Welcome {}, userid {}!", name, userid)) } pub fn main() { use actix_web::{App, HttpServer}; HttpServer::new(|| { App::new().route( "/users/{userid}/{friend}", // <- define path parameters web::get().to(index), ) }) .bind("127.0.0.1:8088") .unwrap() .run() .unwrap(); } //