aboutsummaryrefslogtreecommitdiff
path: root/web/webserver.scm
diff options
context:
space:
mode:
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)