aboutsummaryrefslogtreecommitdiff
path: root/web/webserver.scm
diff options
context:
space:
mode:
authorPjotr Prins2023-09-11 16:47:48 -0500
committerPjotr Prins2023-09-11 16:47:48 -0500
commitacaea1fb7d6544a98867a16b283085592a042b9f (patch)
tree2c878c364e65fb72599db3381c2b645d385e1cf4 /web/webserver.scm
parentd293a72b32b6da819365c48f111b0073a1fb7d5e (diff)
downloadgn-guile-acaea1fb7d6544a98867a16b283085592a042b9f.tar.gz
Adding pico css
Diffstat (limited to 'web/webserver.scm')
-rwxr-xr-xweb/webserver.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/web/webserver.scm b/web/webserver.scm
index ce4ab9d..fe4596b 100755
--- a/web/webserver.scm
+++ b/web/webserver.scm
@@ -98,6 +98,12 @@ otherwise search for set/group data"
(last-modified . ,(time-utc->date modified)))
(call-with-input-file file-name get-bytevector-all))))
+(define* (render-file path page #:optional rec #:key (extra-headers '()))
+ (list (append extra-headers
+ '((content-type . (text/html))))
+ (lambda (port)
+ (sxml->html (view-doc path page rec) port))))
+
(define* (render-doc path page #:optional rec #:key (extra-headers '()))
(list (append extra-headers
'((content-type . (text/html))))
@@ -126,6 +132,8 @@ otherwise search for set/group data"
(render-json info))
(('GET "version")
(render-json get-version))
+ (('GET "css" fn)
+ (render-file fn))
(('GET "static" "images" fn)
(render-static-image (string-append "static/images/" fn)))
(('GET "home" path)