在Compojure中组合路线 [英] Combining routes in Compojure

查看:135
本文介绍了在Compojure中组合路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个不同的Web应用程序在Clojure开发与Compojure。

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

如何将defroutes的两个不同定义合并到一个defroute中?

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.

推荐答案

您可以使用compojure.core/routes 结合路线:

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

这篇关于在Compojure中组合路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆