OyvindSabo/sharp-router

Clearly define precedence for router match conflicts

Opened this issue · 0 comments

I should be specific about precedence for routes which match both to a static route and a parameterized route. For instance, whether #/products/list should match to /products/list or /products/<id:string>.

A simple way to define precedence (and perhaps the way it is now) is to let precedence be defined by the order the route patterns are defined. Another way is to let static routes take precedence over parameterized route patterns.

If I were to make it more complicated with some predefined precedence, I would also need to decide what should be prioritied of routes with string parameters and number parameters, since all number parameters can be interpreted as strings.