Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (18 sloc) 513 Bytes
; A example of modular construction of Ring apps.
(ns ring.example.wrapping
(:use (ring.handler dump)
(ring.middleware stacktrace file-info file)
(ring.adapter jetty)
(clojure.contrib except)))
(defn wrap-error [app]
(fn [req]
(if (= "/error" (:uri req))
(throwf "Demonstrating ring.middleware.stacktrace")
(app req))))
(def app
(-> handle-dump
wrap-error
(wrap-file "example/public")
wrap-file-info
wrap-stacktrace))
(run-jetty app {:port 8080})
Jump to Line
Something went wrong with that request. Please try again.