How do I stop jetty server in clojure?

前端 未结 2 747

I am writing a web application using ring and clojure. I am using the jetty adapter for the development server and emacs/SLIME for IDE. While wrap-reload does help, run-jetty bl

2条回答
  •  一个人的身影
    2021-01-30 03:50

    I usually have a line in my Ring app that looks like the following:

    (defonce server (run-jetty #'my-app {:port 8080 :join? false}))
    

    This prevents locking up the REPL. It also allows me to recompile this file without worrying that my server will get redefined. It also lets you interact at the REPL like so:

    user=> (.stop server)
    

    and

    user=> (.start server)
    

提交回复
热议问题