Combining routes in Compojure

前提是你 提交于 2019-12-10 01:31:59

问题


I have two different web applications in Clojure developed with Compojure. Each use defroutes to create its handler.

How can I combine the two different definitions of defroutes into one defroute? I want to reuse the routes of the first app into the second.


回答1:


You can use compojure.core/routes to combine routes:

 (def my-handler
    (routes some-handler
            some-other-handler))


来源:https://stackoverflow.com/questions/8329173/combining-routes-in-compojure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!