【问题标题】:How to configure Jetty settings in project.clj and use Lein Ring in Clojure?如何在 project.clj 中配置 Jetty 设置并在 Clojure 中使用 Lein Ring?
【发布时间】:2016-04-28 13:15:17
【问题描述】:

我想为 Jetty Adapter 添加一些配置并使用 lein-ring 插件运行它,但我找不到任何信息。

我可以使用lein run 运行从主函数配置的这个。

(jet/run-jetty main-handler {:port 8080 :join? false})

但我想在 project.clj 中设置这些配置,以便我可以使用“lein ring server”。

【问题讨论】:

    标签: clojure jetty leiningen embedded-jetty


    【解决方案1】:

    lein-ring documentation 建议您可以在 project.clj 文件中放置环形适配器的选项图,如下所示:

    :ring {:handler hello-world.core/handler
           :adapter {:join? false
                     :port 8080}}
    

    虽然你可能不想使用:join? false 我想。

    【讨论】:

      猜你喜欢
      • 2012-05-04
      • 1970-01-01
      • 2014-04-17
      • 1970-01-01
      • 2020-09-07
      • 2019-01-21
      • 2019-08-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多