Open
Description
Problem
If there is already some static html occupying a path, access using url on the page won't trigger custom route matching in my app. For example, a static html file is put at path /post/hello.html
, and this will make route matching arm Route::Post
unmatchable
#[derive(Clone, Routable, PartialEq)]
enum Route {
#[at("/")]
Home,
#[at("/post/:id")]
Post { id: String },
#[not_found]
#[at("/404")]
NotFound,
}
Steps To Reproduce
- Clone this repository, which stores the related codes
git clone https://github.com/sammyne/yew-router-path-cannot-captured cd yew-router-path-cannot-captured
- Install tools
rustup target add wasm32-unknown-unknown cargo install trunk wasm-bindgen-cli
- Start the server
trunk serve
- Visit
http://127.0.0.1:8080/post/hello.html
,and check log in Console of DevTools.
Expected behavior
See logs post id=hello.html
in Console
Environment:
- Yew version: v0.21.0
- Yew Router version: v0.18.0
- Rust version: 1.73.0
- Target, if relevant:
wasm32-unknown-unknown
- Build tool, if relevant:
trunk
- OS, if relevant: Debian GNU/Linux 11 (bullseye)
- Browser and version, if relevant: Chrome 120.0.6073.0 64-bits