Rename resource fns

This commit is contained in:
Marcin Kulik 2017-03-10 23:08:31 +01:00
parent 290cd74126
commit bc6f1ed3c7

View File

@ -23,7 +23,7 @@
(or (executor/execute executor f) (or (executor/execute executor f)
(service-unavailable-response ctx))) (service-unavailable-response ctx)))
(defn asciicast-json-resource [db file-store] (defn asciicast-file-resource [db file-store]
(resource (resource
{:produces "application/json" {:produces "application/json"
:parameters {:path {:token String} :parameters {:path {:token String}
@ -41,7 +41,7 @@
(def png-ttl-days 7) (def png-ttl-days 7)
(defn asciicast-png-resource [db file-store exp-set executor png-gen] (defn asciicast-image-resource [db file-store exp-set executor png-gen]
(resource (resource
{:produces {:produces
"image/png" "image/png"
@ -85,6 +85,6 @@
(fstore/serve-file file-store ctx png-store-path {}))))))})) (fstore/serve-file file-store ctx png-store-path {}))))))}))
(defn asciicasts-endpoint [{:keys [db file-store exp-set executor png-gen]}] (defn asciicasts-endpoint [{:keys [db file-store exp-set executor png-gen]}]
["" [["/a/" [[[:token ".json"] (asciicast-json-resource db file-store)] ["" [["/a/" [[[:token ".json"] (asciicast-file-resource db file-store)]
[[:token ".png"] (asciicast-png-resource db file-store exp-set executor png-gen)]]] [[:token ".png"] (asciicast-image-resource db file-store exp-set executor png-gen)]]]
[true (yada/resource not-found-model)]]]) [true (yada/resource not-found-model)]]])