2018-05-24 19:13:55 +02:00
|
|
|
// <pbuf>
|
2019-06-28 19:31:30 +02:00
|
|
|
use actix_web::{HttpRequest, Result};
|
2018-05-24 19:13:55 +02:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
2019-06-17 08:08:42 +02:00
|
|
|
fn index(req: HttpRequest) -> Result<String> {
|
|
|
|
let path: PathBuf = req.match_info().query("tail").parse().unwrap();
|
2018-05-24 19:13:55 +02:00
|
|
|
Ok(format!("Path {:?}", path))
|
|
|
|
}
|
|
|
|
|
2019-06-19 06:20:50 +02:00
|
|
|
pub fn main() {
|
2019-06-28 19:31:30 +02:00
|
|
|
use actix_web::{web, App, HttpServer};
|
2019-06-26 00:20:36 +02:00
|
|
|
|
|
|
|
HttpServer::new(|| App::new().route(r"/a/{tail:.*}", web::get().to(index)))
|
|
|
|
.bind("127.0.0.1:8088")
|
|
|
|
.unwrap()
|
|
|
|
.run()
|
|
|
|
.unwrap();
|
2018-05-24 19:13:55 +02:00
|
|
|
}
|
|
|
|
// </pbuf>
|