forked cemerick / compojure (April 18th 2010); a compojure 0.3.3
Compojure is an open source web framework for the Clojure programming language. It emphasizes a thin I/O layer and a functional approach to web development.
The forked version includes multipart with FileUpload. This causes on google app engine an error: java.rmi.server.UID is a restricted class.
Alternatively, you can use a "normal" compojure and define the compojure.http usage more specific: (:use [compojure.http servlet routes helpers])
"And now I’m ready for anything and everything – including your ants." -- Leiningen Versus the Ants by Carl Stephenson
Leiningen can do anything and everything: lein jar
Just add this in your project.clj file under :dependencies [compojure-gae "0.3.3"]
The jar file is hosted by Clojars.org.
Compojure 0.4.x uses ring as library and therefore another different namespace is required.
Here's a small web application written in Compojure:
(use 'compojure)
(defroutes my-app
(GET "/"
(html [:h1 "Hello World"]))
(ANY "*"
(page-not-found)))
(run-server {:port 8080}
"/*" (servlet my-app))
To run Compojure, you'll need:
- The Clojure programming language
- The Clojure-Contrib library
- A Java servlet container like Jetty
- Apache Commons IO and Codec.
These dependencies can be downloaded automatically using:
ant deps
For information on how to get started and use Compojure, please see our Wiki.
There is also a rough draft of a Compojure Tutorial available to read.
The Compojure Group is the best place to ask questions about Compojure, suggest improvements or to report bugs.
Eric Lavigne has written a series of excellent tutorials on Compojure:
- Install Compojure on a Slicehost VPS
- Using PostgreSQL with Compojure
- Compojure security: authentication and authorization
John Hume has written about: