Created
April 28, 2012 11:02
-
-
Save tcoupland/2517996 to your computer and use it in GitHub Desktop.
Simple compojure handler with logging middleware
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns compojur-learning.core | |
(:use compojure.core)) | |
(defroutes handler | |
(GET "/" [] (println "middle") {:status 200})) | |
(defn logging [chain] (fn [req] ( | |
(println "before") | |
(chain req) | |
(println "after")))) | |
(def app (-> handler logging)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment