I suppose this is a strange question to the huge majority of programmers that work daily with Java. I don't. I know Java-the-language, because I worked on Java projects, but not Java-the-world. I never made a web app from scratch in Java. If I have to do it with Python, Ruby, I know where to go (Django or Rails), but if I want to make a web application in Clojure, not because I'm forced to live in a Java world, but because I like the language and I want to give it a try, what libraries and frameworks should I use?


当前回答

声明:我是作者。

我把一个leiningen模板结合luminusweb和栗子模板。 所以你得到了一些东西,你可以用它来构建clojure代码以及前端和后端clojurescript代码。 此外,它还提供用户管理、一些简单的CRUD生成和一些更小的功能:https://github.com/sveri/closp

其他回答

还有“Noir”(http://www.webnoir.org/),这是一个新的Clojure web框架(太新了,文档还没有)。来自Django/Rails,我喜欢简单、直接的语法,它非常精简。

你也可以尝试Clojure线圈,http://github.com/zubairq/coils -免责声明:我是作者

另一个有趣的web服务器是Http-kit。它有很好的性能,是ring兼容的,并且也支持WebSockets。它主要是用clojure开发的,缺少Jetty/Tomcat中的一些奇怪的东西。

这很容易修补。

到目前为止,我所遇到的最好的Clojure web框架是Compojure: http://github.com/weavejester/compojure/tree/master

它很小,但功能强大,并且具有漂亮优雅的语法。(它在底层使用Jetty,但它对您隐藏了Servlet API,除非您需要它,但这种情况不会经常发生)。去看看那个URL的README,然后下载一个快照并开始播放。

我已经成功地在生产环境中使用Liberator一段时间了。如果你只是想要一个基本的框架,例如,如果你正在构建一个RESTful web服务或类似的东西,它是一个很好的框架。它本质上是ring和compojure的包装器,并在验证传入请求时提供决策图。与其他更笨重的web框架相比,它的速度也非常快。如果你想快速开始,然后慢慢建立,那么解放者是一个很好的选择。