Ask HN: Clojure best practice for web applications?
Does anybody here have experience building a web application using Clojure?
I would like to be able to set up a mysql driven web application using clojure as the language to build it in, but I don't know where to begin to look for the 'best of breed' components to do this with.
This is my first foray in to the big and scary world of functional programming, a trial project to be followed by a much larger one.
Any pointers in the right direction would be greatly appreciated.
10 comments
[ 3.4 ms ] story [ 37.4 ms ] threadI wrote a small Compojure application about a week ago. It's only an afternoon's worth of work, plus some cleaning up later, so should also be easy for a newcomer to digest.
The source code is here: http://github.com/ericlavigne/island-wari
You can try out the application here: http://ericlavigne.net:8054
I have been learning Clojure, and the lack of responses is a bit of a surprise.
Perhaps #clojure on freenode will get more responses?
To get you started, have a look at the source for clojars and briancarpers cow-blog.
http://github.com/ato/clojars-web http://github.com/briancarper/cow-blog
Brian Carper has a load of information about using compojure on his site (http://briancarper.net). In particular interest are:
compojure to the rescue: http://briancarper.net/blog/clojure-and-compojure-to-the-res...
deploying clojure sites http://briancarper.net/blog/deploying-clojure-websites
It was a nice experience, functional programming fits well to website programming (the response is a function of the request and data in the database).
For debugging/development purposes I strongy recommend to reload the code on each request using load-file. Restarting the server every time a change is made is unbearable.