本文介绍了webjure vs compojure?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我听说过两个基于Clojure的Web应用程序框架:Webjure和Compojure。有人可以让我知道哪个更好?
I've heard of two Clojure based web application frameworks: Webjure and Compojure. Can someone let me know which is better?
推荐答案
Compojure对我来说一直工作得很好。我喜欢设计的简单性,灵活性和鼓励一个很好的惯用功能风格的事实。
Compojure has been working very well for me so far. I like the simplicity of the design, the flexibility and the fact that it encourages a nice idiomatic functional style.
示例服务器:
(use 'compojure)
(defroutes my-app
(GET "/index.html"
(html
[:h1 "Hello World!!"]
[:body "This is some text"]))
(ANY "*"
[404 "Page not found"]))
(run-server {:port 80}
"/*" (servlet my-app))
注意,Compojure在内部使用Ring。
Note that Compojure uses Ring internally.
这篇关于webjure vs compojure?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!