如何在Clojure中创建Web应用程序?

问题描述:

我想这是一个奇怪的问题,绝大多数程序员每天与Java工作。我不。我知道Java语言,因为我从事Java项目,但不是Java世界。我从来没有从头开始制作一个web应用程序。如果我必须使用Python,Ruby,我知道去哪里(Django或Rails),但如果我想在Clojure中创建一个Web应用程序,而不是因为我*在Java世界中生活,而是因为我

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?

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

By far the best Clojure web framework I have yet encountered is Compojure: http://github.com/weavejester/compojure/tree/master

它虽小但功能强大,语法优美。 (它使用Jetty在引擎盖下,但它隐藏的Servlet API从你,除非你想要,这不会经常)。查看该网址上的README,然后下载快照并开始播放。

It's small but powerful, and has beautifully elegant syntax. (It uses Jetty under the hood, but it hides the Servlet API from you unless you want it, which won't be often). Go look at the README at that URL, then download a snapshot and start playing.