Preliminary static assets serving.

This commit is contained in:
Dominik Pantůček 2025-03-31 22:30:28 +02:00
parent cd36a88d12
commit 03c744e9f1

View file

@ -23,10 +23,10 @@
;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
;;
(import (chicken process-context)
srfi-4
(chicken file)
(chicken pathname)
(chicken format))
(chicken format)
(chicken io))
(define (get-argv)
(let* ((args (argv))
@ -78,8 +78,11 @@
(if (null? tree)
alst
(let* ((fpath (car tree))
(key (substring fpath dir-len))
(value (with-input-from-file fpath read-u8vector)))
(key0 (substring fpath dir-len))
(key (if (eq? (string-ref key0 0) #\/)
(substring key0 1)
key0))
(value (with-input-from-file fpath read-string)))
(loop (cdr tree)
(cons (cons key value)
alst)))))))