diff --git a/src/web.lisp b/src/web.lisp index 0b4cd39..f228328 100644 --- a/src/web.lisp +++ b/src/web.lisp @@ -759,6 +759,15 @@ (nera:get-storage-file :slug slug)))) (on-exception *web* 404))) +(defroute ("/storage/thumb/media/:slug" :method :GET) (&key slug) + (let ((storage-file (nera:get-storage-file :slug slug))) + (if storage-file + `(200 (:content-type ,(files::file-type-of storage-file)) + ,(storage:open-binary-file + "" "media" + (format nil "thumbnail-~a" (files::name-of storage-file)))) + (on-exception *web* 404)))) + (defroute ("/storage/thumb/archive/:slug" :method :GET) (&key slug) (if (nera:get-archive-entry :slug slug) (let ((archive-entry (nera:get-archive-entry :slug slug)))