Skip to content

Instantly share code, notes, and snippets.

@zaiste
Created May 26, 2012 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zaiste/2794258 to your computer and use it in GitHub Desktop.
Save zaiste/2794258 to your computer and use it in GitHub Desktop.
Ring Middleware Order
(defn handler [request]
{:status 200
:headers {"Content-Type" "text/plain"}
:body "Hello, Ring!"})
(defn show-params [handler]
(fn [request]
(let [response (handler request)]
(println (str request))
response)))
(def app
(-> handler
(show-params)
(wrap-resource "public")
(wrap-file-info)
(wrap-content-type "text/plain")
(wrap-keyword-params)
(wrap-params)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment