1
0
mirror of https://github.com/actix/actix-website synced 2025-07-03 01:54:32 +02:00
Files
actix-website/examples/url-dispatch/src/pbuf.rs

14 lines
331 B
Rust

// <pbuf>
use actix_web::{web, App, HttpRequest, Result};
use std::path::PathBuf;
fn index(req: HttpRequest) -> Result<String> {
let path: PathBuf = req.match_info().query("tail").parse().unwrap();
Ok(format!("Path {:?}", path))
}
pub fn main() {
App::new().route(r"/a/{tail:.*}", web::get().to(index));
}
// </pbuf>