Clojure & Google App Engine Setup - Update

We posted an article about interactively developing Clojure applications on Google App Engine some time ago. We use this setup for developing our online todo manager TheDeadline which is now an open beta and accepts registrations from everyone.

As http://blog.miau.biz/2010/01/interactive-clojure-on-appengine-pt2.html correctly pointed out, the old setup didn't work out of the box for serving static files.

We'd like to post some updated and cleaned up setup code that works with the current App Engine SDK and also facilitates writing a web based application.


Have a look here.

Assuming you already defined your Compojure routes named "app", all you have to do is the following:

(ns start
(:require [com.freiheit.clojure.appengine.appengine-local :as gae-local]))

(defn start-server
[]
(gae-local/defgaeserver app-server app)
(gae-local/start-gae-server app))


This also does some setup for service static files you usually need in a web application. The code determines your current working directory and looks for a directory called src/web. Files in the subdirectories "js", "css" and "static" are automatically served as static files.