項目環境:
3.2.0-52-generic #78-Ubuntu SMP Fri Jul 26 16:21:44 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Leiningen 2.3.2 on Java 1.6.0_43 Java HotSpot(TM) 64-Bit Server VM
[[org.clojure/clojure "1.5.1"][ring/ring-core "1.2.0"][ring/ring-jetty-adapter "1.2.0"]]
1. 生成web項目:
lein new hello-world
cd hello-world
<參考 https://github.com/ring-clojure/ring/wiki/Getting-Started >
2. 啓動web服務:
user=>(use 'ring.adapter.jetty)
user=>(use 'hello-world.core)
user=>(defonce server (run-jetty #'handler {:port 3000 :join? false}))
user=>(.stop server) #關閉web服務
user=>(.start server) #開啓web服務
3. lein ring項目關閉調試信息,參考lein-ring插件README https://github.com/weavejester/lein-ring
環境: org.clojure/clojure "1.5.1" / lein-ring "0.8.7"/ Leiningen 2.3.3 on Java 1.6.0_30 Java HotSpot(TM) 64-Bit Server VM
在project.clj修改
:ring {:handler beta_deploy.core/app}
爲:git
:ring {:handler beta_deploy.core/app :stacktraces? false}