Skip to content

Instantly share code, notes, and snippets.

@KirinDave
Created January 8, 2010 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save KirinDave/bcac547ff8ebfde2c982 to your computer and use it in GitHub Desktop.
Save KirinDave/bcac547ff8ebfde2c982 to your computer and use it in GitHub Desktop.
(defn dump-sesh [request]
{:body (str "<html><head><title>ok</title></head></body>Seshtown: " (:session request))
:session {:x 1}})
(defroutes main-app
(RESOURCE "css" "css")
(RESOURCE "js" "javascript")
(RESOURCE "(png|jpg|gif)" "images")
(GET "/t1" (with-session dump-sesh))
(ANY "/" (with-league (get-league! "default")
(league-home)))
(ANY "*" "Fell Through!"))
(defn start-server
([port] (run-server {:port port} "/*" (servlet (with-session main-app))))
([] (start-server 8080)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment