我正在尝试在我的应用程序中设置路由,以便:
- /:locale/ -> Home,带有区域绑定
- /:locale/search -> 搜索,使用语言环境绑定
到目前为止,我的路由代码是:
(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"))
搜索/c-路线:
(defn c-routes [locale]
(GET "/search" [] (index locale)))
家/ c路线:
(defn c-routes [locale]
(GET "/" [] (index locale)))
我不明白为什么这不能正常工作,但目前“/uk/search/”匹配正确,但“/uk/”给出了 404 页面。
任何帮助,将不胜感激。谢谢。