- Adapater Http Request -> Ring Request Ring Resposne -> Http Response
- Handler Ring Request -> Http Response Basically clojure function
(defn handler [req]
{:status: 200
:body "Hello, world!"
:headers {}})
- Middleware Handler + Options -> Handler
(defn mw [hdlr & options]
(fn [req]
(hdlr (modify req)))
(defn mw [hdlr & options]
(fn [req]
(modify (hdlr req)))
(defn mw [hdlr & options]
(fn [req]
(do-something)
(hdlr req))
- Routing Path + Http Method route to specific Handler
(defroute rotues
(Get "/" [] home-handler)
...
(not-found "Page not found."))