在使用boot运行时,我无法从http-kit服务器获得任何响应。它适用于jetty。当我运行boot run时,它会在一段时间后退出。所以我添加了(boot (wait)),它不会终止,但服务器似乎没有运行。
; core.clj
(ns server.core
(:use [compojure.route :only [files not-found]]
[compojure.handler :only [site]]
[compojure.core :only [defroutes GET POST DELETE ANY context]]
org.httpkit.server))
(defn hello []
"Hello from httpkit")
(defroutes api-routes
(GET "/" [] (hello)))
(defn -main []
(run-server api-routes {:port 8080}))boot.clj文件:
;boot.clj
(set-env!
:source-paths #{"src"}
:dependencies '[[org.clojure/clojure "1.8.0"]
[ring "1.5.0"]
[compojure "1.5.1"]
[http-kit "2.2.0"]])
(require '[server.core :as server])
(deftask run []
(with-pre-wrap fileset (server/-main) fileset)
(boot (wait)))发布于 2016-10-17 13:37:15
您可以使用boot-http和类似以下内容:
(boot (serve :handler 'server/-main :reload true) (wait))https://stackoverflow.com/questions/40062648
复制相似问题