Default 404 page
This commit is contained in:
parent
bb4c602a4c
commit
1e08b39e49
@ -1,5 +1,15 @@
|
|||||||
(ns asciinema.yada
|
(ns asciinema.yada
|
||||||
(:require [yada.yada :as yada]))
|
(:require [clojure.java.io :as io]
|
||||||
|
[yada.yada :as yada]))
|
||||||
|
|
||||||
|
(defn not-found-response [ctx]
|
||||||
|
(case (yada/content-type ctx)
|
||||||
|
"text/html" (io/input-stream (io/resource "asciinema/errors/404.html"))
|
||||||
|
"Not found"))
|
||||||
|
|
||||||
(defn resource [model]
|
(defn resource [model]
|
||||||
(yada/resource model))
|
(-> model
|
||||||
|
(update-in [:responses 404] #(or %
|
||||||
|
{:produces #{"text/html" "text/plain"}
|
||||||
|
:response not-found-response}))
|
||||||
|
yada/resource))
|
||||||
|
Loading…
Reference in New Issue
Block a user