Use httpkit to replace jetty and httpkitjetty
CompojureIsRingThe upper-Layer web development framework. In the project generated by lein new compojure my-app, jetty server is enabled by default and websocket in http-kit is recently used. Therefore, you need to change the server to http-kit. In fact, it is very easy to replace run-jetty with run-server. The two parameters are the same:
(run-jetty app options)(run-server app options)
Note the following two points after the change:
1.1 start
Previously, the lein ring server can be started directly, and hot code updates are supported by default. After changing to http-kit, lein run is required.
Previously, lein ring server
; Lein run after modification
1.2 code hot update
After the above configuration, the code will not be hot updated. To support code hot update, use ring. middleware. reload to manually configure it:
(Defn-main [& args]; entry function (let [handler (reload/wrap-reload (site # 'all-routes)]; reload/wrap-reload middleware is a hot update feature (run-server handler {: port 8080}); run-server to Use http-kit