Use wrapper for yada/resource
This commit is contained in:
parent
3424505587
commit
bb4c602a4c
@ -7,6 +7,7 @@
|
|||||||
[user-database :as udb]]
|
[user-database :as udb]]
|
||||||
[asciinema.model.asciicast :as asciicast]
|
[asciinema.model.asciicast :as asciicast]
|
||||||
[asciinema.util.io :refer [with-tmp-dir]]
|
[asciinema.util.io :refer [with-tmp-dir]]
|
||||||
|
[asciinema.yada :refer [resource]]
|
||||||
[clj-time.core :as t]
|
[clj-time.core :as t]
|
||||||
[clojure.java
|
[clojure.java
|
||||||
[io :as io]
|
[io :as io]
|
||||||
@ -53,7 +54,8 @@
|
|||||||
(service-unavailable-response ctx)))
|
(service-unavailable-response ctx)))
|
||||||
|
|
||||||
(defn asciicast-json-resource [db file-store]
|
(defn asciicast-json-resource [db file-store]
|
||||||
(yada/resource {:produces "application/json"
|
(resource
|
||||||
|
{:produces "application/json"
|
||||||
:parameters {:path {:token String}
|
:parameters {:path {:token String}
|
||||||
:query {(s/optional-key :dl) s/Bool}}
|
:query {(s/optional-key :dl) s/Bool}}
|
||||||
:properties (fn [ctx]
|
:properties (fn [ctx]
|
||||||
@ -69,7 +71,8 @@
|
|||||||
(fstore/serve-file file-store ctx path (when dl {:filename filename}))))}))
|
(fstore/serve-file file-store ctx path (when dl {:filename filename}))))}))
|
||||||
|
|
||||||
(defn asciicast-png-resource [db file-store exp-set executor]
|
(defn asciicast-png-resource [db file-store exp-set executor]
|
||||||
(yada/resource {:produces "image/png"
|
(resource
|
||||||
|
{:produces "image/png"
|
||||||
:parameters {:path {:token String}
|
:parameters {:path {:token String}
|
||||||
:query {(s/optional-key :time) s/Num
|
:query {(s/optional-key :time) s/Num
|
||||||
(s/optional-key :theme) Theme
|
(s/optional-key :theme) Theme
|
||||||
|
5
src/asciinema/yada.clj
Normal file
5
src/asciinema/yada.clj
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
(ns asciinema.yada
|
||||||
|
(:require [yada.yada :as yada]))
|
||||||
|
|
||||||
|
(defn resource [model]
|
||||||
|
(yada/resource model))
|
Loading…
Reference in New Issue
Block a user