File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 44 :license {:name " Eclipse Public License"
55 :url " http://www.eclipse.org/legal/epl-v10.html" }
66 :plugins [[lein-ring " 0.8.7" ]]
7- :ring {:handler project1.core/wrapping -handler
7+ :ring {:handler project1.core/full -handler
88 :init project1.core/on-init
99 :port 4001
1010 :destroy project1.core/on-destroy}
Original file line number Diff line number Diff line change 11(ns project1.core
22 (:require [project1.handlers :as handlers]))
33
4+ (defn simple-log-middleware [handler]
5+ (fn [{:keys [uri] :as request}]
6+ (println " Request path:" uri)
7+ (handler request)))
8+
49(defn example-handler [request]
510 {:headers {" Location" " http://github.com/ring-clojure/ring"
611 " Set-cookie" " test=1" }
3944 {:status 404 :body (str " Not found: " (:uri request))})
4045 (catch Throwable e
4146 {:status 500 :body (apply str (interpose " \n " (.getStackTrace e)))})))
47+
48+ (def full-handler
49+ (simple-log-middleware wrapping-handler))
You can’t perform that action at this time.
0 commit comments