Skip to content

Instantly share code, notes, and snippets.

@mirrormatch
Created January 8, 2011 19:30
Show Gist options
  • Save mirrormatch/771078 to your computer and use it in GitHub Desktop.
Save mirrormatch/771078 to your computer and use it in GitHub Desktop.
;; The middleware takes 'app' as its parameter. In this
;; context app is going to be either another middleware
;; or the route handler.
;;
;; The return value is a new function that does the
;; processing you need and continues the middleware
;; chain.
(defn my-middleware [app]
(fn [request]
;; This is where you'd do any processing on the request
;; Finally, keep the chain going by calling app
(app request)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment