在 Compojure 中组合路线

发布于 2024-12-18 23:20:13 字数 145 浏览 3 评论 0原文

我在 Clojure 中使用 Compojure 开发了两个不同的 Web 应用程序。每个都使用 defroutes 来创建其处理程序。

如何将 defroutes 的两种不同定义合并为一个 defroute?我想将第一个应用程序的路由重用到第二个应用程序中。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笨死的猪 2024-12-25 23:20:13

您可以使用 compojure.core/routes 来组合路由:

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

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

 (def my-handler
    (routes some-handler
            some-other-handler))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文