Use httpkit to replace jetty and httpkitjetty

Source: Internet
Author: User

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

  

 




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.