matchit icon indicating copy to clipboard operation
matchit copied to clipboard

router /{*path} not work

Open yangqingxin1993 opened this issue 6 months ago • 1 comments

let mut router = matchit::Router::new(); router.insert("/{*path}", "1").unwrap(); router.at("/test").unwrap(); // works router.at("/").unwrap(); // panic

why router.at("/").unwrap() is panic

yangqingxin1993 avatar Jun 25 '25 08:06 yangqingxin1993

Static routes don't allow for empty parameters. You can add / as a separate route to the same value if you want that behavior.

ibraheemdev avatar Jun 25 '25 14:06 ibraheemdev

Feel free to reopen if you have further questions.

ibraheemdev avatar Jul 18 '25 15:07 ibraheemdev