刚刚接触clojure,试了一下用lein构建简单的web应用,发现:
- 使用
lein run
,或者是lein ring server
来启动项目成功后却不返回到shell; - 使用
lein uberjar
打包后直接通过java -jar
来启动同样不返回shell; - 使用
java -server -cp `lein classpath` clojure.core -m web.core
启动也是如此。
想知道在生产环境中怎么部署,像daemon一样。
;;project.clj的内容
(defproject web "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[ring "1.4.0"]
[compojure "1.5.0"]
[http-kit "2.1.19"]]
:main web.core)
运行截图: