1
0
mirror of https://github.com/actix/actix-website synced 2024-12-04 04:31:55 +01:00
actix-website/examples/url-dispatch/src/pbuf.rs
2018-07-21 05:21:41 -07:00

16 lines
365 B
Rust

// <pbuf>
use actix_web::{http::Method, App, HttpRequest, Result};
use std::path::PathBuf;
fn index(req: &HttpRequest) -> Result<String> {
let path: PathBuf = req.match_info().query("tail")?;
Ok(format!("Path {:?}", path))
}
fn main() {
App::new()
.resource(r"/a/{tail:.*}", |r| r.method(Method::GET).f(index))
.finish();
}
// </pbuf>