Created
May 26, 2012 15:04
-
-
Save zaiste/2794258 to your computer and use it in GitHub Desktop.
Ring Middleware Order
This file contains 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
(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