Browse Source

response implemented

master
Christian Mueller 12 years ago
parent
commit
2164ae1a60
  1. 7
      src/NoteHub/handler.clj

7
src/NoteHub/handler.clj

@ -77,9 +77,10 @@
"Sets a custom message for each needed HTTP status. "Sets a custom message for each needed HTTP status.
The message to be assigned is extracted with a dynamically generated key" The message to be assigned is extracted with a dynamically generated key"
[code] [code]
(let [message (get-message (keyword (str "status-" code)))] {:status code
:body (let [message (get-message (keyword (str "status-" code)))]
(layout message (layout message
[:article [:h1 message]]))) [:article [:h1 message]]))})
(defn redirect [url] (defn redirect [url]
{:status 302 {:status 302
@ -205,7 +206,7 @@
(response 500)))) (response 500))))
(route/resources "/") (route/resources "/")
(route/not-found "Not Found")) (route/not-found (response 404)))
(def app (def app
(handler/site app-routes)) (handler/site app-routes))

Loading…
Cancel
Save