diff --git a/src/api/router.rs b/src/api/router.rs index 41b922e5..2af43141 100644 --- a/src/api/router.rs +++ b/src/api/router.rs @@ -42,8 +42,8 @@ impl Router { self } - pub fn match_all(mut self, router: Router) -> Self { - self.subroute = SubRoute::MatchAll { router: Box::new(router), param_name: "test".into() }; + pub fn match_all(mut self, param_name: S, router: Router) -> Self where S: Into { + self.subroute = SubRoute::MatchAll { router: Box::new(router), param_name: param_name.into() }; self } diff --git a/src/api3.rs b/src/api3.rs index 805e3414..605cf27c 100644 --- a/src/api3.rs +++ b/src/api3.rs @@ -58,7 +58,7 @@ pub fn router() -> Router { }); let route = Router::new() - .match_all(route2); + .match_all("node", route2); route }