diff --git a/src/asciinema/yada.clj b/src/asciinema/yada.clj index e440063..e15788e 100644 --- a/src/asciinema/yada.clj +++ b/src/asciinema/yada.clj @@ -1,5 +1,15 @@ (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] - (yada/resource model)) + (-> model + (update-in [:responses 404] #(or % + {:produces #{"text/html" "text/plain"} + :response not-found-response})) + yada/resource))