@roberto this defines the defaults for the route pattern. So, the first route definition matches either "foo" => {:page "foo"}
or "" => {:page "home"}
so, would just specifying “home” work?
:routes [“home” “:page/:slug” “:page/:slug/:action”]
I think you could specify it like this :routes [["" {:page "home"}]]
but I'm not sure, I'll have to write a test for that :simple_smile:
basically the idea is that you have a pattern and when you pass in the data it will try to find the best route match based on the data + pattern defaults
but in the place my order app
it has 3 urls that are matched by that route (home, restaurants and order-history)
so it makes sense to define the route like that
when trying to locate a route, it does so sequentially?
it will calculate the score for each route and then pick the best one https://github.com/keechma/keechma/blob/master/src/keechma/router.cljs#L91-L103
oh, so it converts them to a set, cool. I was worried about having a long list of routes and the application slowing down because of that.
but then again, that shouldn’t be happening (writing an app with hundreds of routes)
yeah, I've used CanJS for years (and the router is ported from CanJS) and usually I would have way less than 10 route patterns
you don't really need that much when you just translate data from one format to another
+ I really like to use query params in some cases