1
0
mirror of https://github.com/actix/actix-website synced 2025-02-13 08:32:20 +01:00
2019-06-17 02:08:42 -04:00

16 lines
349 B
Rust

// <path>
use actix_web::{web, App, Result};
// extract path info using serde
fn index(info: web::Path<(String, u32)>) -> Result<String> {
Ok(format!("Welcome {}! id: {}", info.0, info.1))
}
fn main() {
App::new().route(
"/{username}/{id}/index.html", // <- define path parameters
web::get().to(index),
);
}
// </path>