【问题标题】:Is there a way to do a hot reload in compojure?有没有办法在 compojure 中进行热重载?
【发布时间】:2012-01-20 18:21:57
【问题描述】:

我是 clojure 和 compojure 的新手,我想知道是否有办法像使用 Ruby 的 Sinatra(使用 shotgun gem)或 Java 的 Play 那样对代码更改进行热重载!

我正在关注这个Heroku tutorial,所以如果有办法用工头宝石来做这件事也可以。

谢谢!

【问题讨论】:

  • 我刚刚回答了一个类似的问题here。希望对你有帮助

标签: clojure reload compojure foreman


【解决方案1】:
【解决方案2】:

Compojure 的最新版本通过将所有中间件合并到一个函数调用中使其变得更加容易:

https://github.com/weavejester/compojure/wiki/Getting-Started

特别是……

(require '[compojure.handler as handler])

; define my-routes in here as normal
(handler/site my-routes)

我在自己的项目中使用了其中的一些。它运行良好,但如果我决定需要添加或删除任何东西,我会直接切换回选择环中间件。

【讨论】:

    猜你喜欢
    • 2012-09-23
    • 2020-11-07
    • 1970-01-01
    • 1970-01-01
    • 2021-09-09
    • 2022-06-10
    • 2023-03-06
    • 2015-03-27
    相关资源
    最近更新 更多