Permalink
Newer
Older
100644 23 lines (18 sloc) 513 Bytes
cbeebac @mmcgrana Initial refactor towards 0.1.
authored Jul 11, 2009
1 ; A example of modular construction of Ring apps.
2
3 (ns ring.example.wrapping
4 (:use (ring.handler dump)
5 (ring.middleware stacktrace file-info file)
6 (ring.adapter jetty)
c5eceba @mmcgrana Fixes to make examples work.
authored Jul 12, 2009
7 (clojure.contrib except)))
cbeebac @mmcgrana Initial refactor towards 0.1.
authored Jul 11, 2009
8
9 (defn wrap-error [app]
10 (fn [req]
11 (if (= "/error" (:uri req))
12 (throwf "Demonstrating ring.middleware.stacktrace")
13 (app req))))
14
15 (def app
16 (-> handle-dump
c5eceba @mmcgrana Fixes to make examples work.
authored Jul 12, 2009
17 wrap-error
f2f4229 @mmcgrana Doc and example tweaks.
authored Feb 23, 2010
18 (wrap-file "example/public")
cbeebac @mmcgrana Initial refactor towards 0.1.
authored Jul 11, 2009
19 wrap-file-info
c5eceba @mmcgrana Fixes to make examples work.
authored Jul 12, 2009
20 wrap-stacktrace))
cbeebac @mmcgrana Initial refactor towards 0.1.
authored Jul 11, 2009
21
22 (run-jetty app {:port 8080})