diff options
author | Pjotr Prins | 2023-08-28 14:51:43 +0200 |
---|---|---|
committer | Pjotr Prins | 2023-08-28 14:51:43 +0200 |
commit | 0f50763c9eef214bc301b7af57e0a59f8d0b761f (patch) | |
tree | 7556080dd26b6d333328a46d704951222dcfc145 /web | |
parent | 89801fbdb731ab64d49dd92fe5ad3ac2ee647e4d (diff) | |
download | gn-guile-0f50763c9eef214bc301b7af57e0a59f8d0b761f.tar.gz |
Serve images
Diffstat (limited to 'web')
-rw-r--r-- | web/view/view.scm | 4 | ||||
-rwxr-xr-x | web/webserver.scm | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/web/view/view.scm b/web/view/view.scm index 6a0b8ba..bdcf009 100644 --- a/web/view/view.scm +++ b/web/view/view.scm @@ -15,5 +15,5 @@ (msk-html #:info '((h2 "Introduction") (p "New project for MSK with some live coding!") - (img (@ (src "/static/images/CMOR.jpg") - )))) + (img (@ (src "/static/images/CMOR.jpg"))) + ))) diff --git a/web/webserver.scm b/web/webserver.scm index d697735..2c9fd53 100755 --- a/web/webserver.scm +++ b/web/webserver.scm @@ -96,8 +96,7 @@ otherwise search for set/group data" (list `((content-type . ,(assoc-ref file-mime-types (file-extension file-name))) (last-modified . ,(time-utc->date modified))) - - (call-with-input-file "./static/images/CMOR.jpg" get-bytevector-all)))) + (call-with-input-file file-name get-bytevector-all)))) (define* (render-doc path page #:optional rec #:key (extra-headers '())) (list (append extra-headers @@ -129,8 +128,8 @@ otherwise search for set/group data" (render-json info)) (('GET "version") (render-json get-version)) - (('GET "static" "images" path) - (render-static-image path)) + (('GET "static" "images" fn) + (render-static-image (string-append "static/images/" fn))) (('GET "brand" path) (render-brand path)) (('GET "doc" "species.html") |