This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-17
Channels
- # aws (2)
- # beginners (34)
- # boot (39)
- # cider (28)
- # cljs-dev (2)
- # cljsrn (30)
- # clojure (195)
- # clojure-austin (6)
- # clojure-dev (6)
- # clojure-dusseldorf (1)
- # clojure-france (1)
- # clojure-russia (139)
- # clojure-spec (25)
- # clojure-uk (66)
- # clojurescript (125)
- # community-development (1)
- # core-async (42)
- # cryogen (1)
- # cursive (22)
- # datascript (6)
- # datomic (67)
- # docker (1)
- # emacs (7)
- # events (1)
- # garden (3)
- # hoplon (15)
- # jobs (3)
- # lein-figwheel (10)
- # leiningen (3)
- # luminus (4)
- # mount (2)
- # nginx (1)
- # off-topic (101)
- # om (42)
- # om-next (6)
- # onyx (7)
- # proton (1)
- # protorepl (4)
- # re-frame (15)
- # reagent (30)
- # remote-jobs (1)
- # ring (8)
- # ring-swagger (17)
- # rum (1)
- # spacemacs (2)
- # sql (1)
- # yada (50)
Is there a definitive "how to install http kit from the ground-up" or "how to replace your current run-jetty with run-server" guide?
I ask because I'm moving my setup (ring on the backend w/ compojure) to use HTTP Kit so I can use Sente (websockets) and... I'm not certain where the heck ring invokes jetty-server, nor am I sure how to replace that with a call to run-server (from httpkit)
How do you normally start your server up?
(since you don’t seem to think your code is calling the run-jetty
function, I suspect you’re relying on a plugin or you’re building an uberjar via a plugin?)
The “simple” answer is that you’ll need a -main
that requires the http-kit namespace and calls run-server
directly (and then “waits around” — by default Jetty starts and joins the main thread so your program automatically waits for Jetty to shutdown; http-kit starts in the background and you have to do something to wait around yourself).
If you’re using Stuart Sierra’s Component library to manage the start/stop lifecycle, you may find this example helpful: https://github.com/framework-one/fw1-clj/blob/master/examples/usermanager/main.clj#L91-L126
It uses a runtime option to decide whether to start Jetty or start http-kit, and it also has the shutdown code.