I am not able to get any response from the http-kit server when running using boot. It works with jetty. When I run the boot run
the it exits after sometime. So I added (boot (wait))
which doesn't terminate, but the server seems to be not running.
; 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}))
The boot.clj
file:
;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)))