exception-middleware
放在multipart/multipart-middleware
之后。:middleware [;; multipart
multipart/multipart-middleware
;; exception handling
exception-middleware]
你可以在《Clojure Cookbook (O'Reilly)》中找到一个基本示例,我强烈推荐:
(ns ringtest
(:require
[ring.adapter.jetty :as jetty]
clojure.pprint))
;; Echo (with pretty-print) the request received
(defn handler [request]
{:status 200
:headers {"content-type" "text/clojure"}
:body (with-out-str (clojure.pprint/pprint request))})
(defn -main []
;; Run the server on port 3000
(jetty/run-jetty handler {:port 3000}))