I'm trying to set up routes in my application such that:
- /:locale/ -> Home, with locale binding
- /:locale/search -> Search, with locale binding
Thus far, my routing code is:
(defn controller-routes [locale]
(home/c-routes locale)
(search/c-routes locale)))
(defroutes app-routes
(route/resources "/")
(context "/:locale" [locale]
(controller-routes locale))
no-locale-route
(route/not-found "Not Found"))
search/c-routes:
(defn c-routes [locale]
(GET "/search" [] (index locale)))
home/c-routes:
(defn c-routes [locale]
(GET "/" [] (index locale)))
I can't understand why this doesn't work properly, but currently "/uk/search/" matches correctly, but "/uk/" gives the 404 page.
Any help would be appreciated. Thanks.