How to use compojure from Intellij

隐身守侯 提交于 2019-12-11 05:47:16

问题


I've spent more time that I want to admit trying to compile and run a compojure app from intellij. From the command line I use lein ring server-headless. If I run from inside intellij the REPL begins and I can't call or start the server from inside the REPL. How can I compile and run a server from inside the REPL?


回答1:


You want to run the server from inside the repl?

Add [ring/ring-jetty-adapter "1.3.1"] as a dependency

In the REPL:

(require 'ring.adapter.jetty)

(require 'quals.core.handler) ; require YOUR ns containing the handler

(ring.adapter.jetty/run-jetty quals.core.handler/app {:port 3004})

You can see all the parameters you can pass here: http://mmcgrana.github.io/ring/ring.adapter.jetty.html

There you have it, the server is running in your repl. If you were looking for more, you can always look at weavejester/lein-ring's source code.

Have fun Clojuring around :)



来源:https://stackoverflow.com/questions/27049424/how-to-use-compojure-from-intellij

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!