Struct poem::route::Route [−][src]
pub struct Route { /* fields omitted */ }
Expand description
Routing object
Implementations
Add an Endpoint to the specified path.
You can match the full path or wildcard path, and use the
Path
extractor to get the path parameters.
Example
use poem::{get, handler, route, web::Path}; #[handler] async fn a() {} #[handler] async fn b(Path((group, name)): Path<(String, String)>) {} #[handler] async fn c(Path(path): Path<String>) {} let app = route() // full path .at("/a/b", get(a)) // capture parameters .at("/b/:group/:name", get(b)) // capture tail path .at("/c/*path", get(c));