mirror of
https://github.com/actix/actix-website
synced 2025-03-15 04:33:07 +01:00
16 lines
353 B
Rust
16 lines
353 B
Rust
|
// <minfo>
|
||
|
use actix_web::{App, HttpRequest, Result};
|
||
|
|
||
|
fn index(req: HttpRequest) -> Result<String> {
|
||
|
let v1: u8 = req.match_info().query("v1")?;
|
||
|
let v2: u8 = req.match_info().query("v2")?;
|
||
|
Ok(format!("Values {} {}", v1, v2))
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
App::new()
|
||
|
.resource(r"/a/{v1}/{v2}/", |r| r.f(index))
|
||
|
.finish();
|
||
|
}
|
||
|
// </minfo>
|