Route ordering for static vs dynamic segments #4349
Unanswered
adrianncovaci
asked this question in
Q&A
Replies: 1 comment
-
|
The router used to (in 0.6 and prior) have a scoring mechanism that tried to pick the most specific route. This mostly just added a bunch of overhead, in binary size and runtime. Now, it simply matches the first matching route — once it has found a route that matches it stops looking for other matches. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When defining routes, it appears that the order of route registration is critical when mixing static and dynamic path segments. For example, having a dynamic route like
/a/b/:idbefore a static route/a/b/ccauses the router to match the dynamic route first, capturingcas the :id parameter instead of routing to the static path.Is this expected? Shouldn't we handle the more specific routes first?
Beta Was this translation helpful? Give feedback.
All reactions