aboutsummaryrefslogtreecommitdiff
path: root/module/entry-points/server.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-03-31 00:40:39 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-03-31 00:40:39 +0200
commit51a2c21f57b3ff3fce3ab7c3c2a9e4985f45258a (patch)
tree1de39df99024c577c5ae42039b4a4b05fd301f41 /module/entry-points/server.scm
parentChange html-generate to take everything as kv-args. (diff)
downloadcalp-51a2c21f57b3ff3fce3ab7c3c2a9e4985f45258a.tar.gz
calp-51a2c21f57b3ff3fce3ab7c3c2a9e4985f45258a.tar.xz
Change url-parsing so '.' is a delimiter.
Diffstat (limited to 'module/entry-points/server.scm')
-rw-r--r--module/entry-points/server.scm15
1 files changed, 10 insertions, 5 deletions
diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm
index c072d18b..0b9512fc 100644
--- a/module/entry-points/server.scm
+++ b/module/entry-points/server.scm
@@ -54,12 +54,17 @@
(sxml->xml-string
(directory-table "static/"))))
- (GET "/static/:filename" (filename)
+ (GET "/static/:filename.css" (filename)
(return
- `((content-type ,(case (string->symbol (file-extension filename))
- ((js) 'text/javascript)
- ((css) 'text/css))))
- (call-with-input-file (string-append "static/" filename) read-string)))
+ `((content-type text/css))
+ (call-with-input-file (string-append "static/" filename ".css")
+ read-string)))
+
+ (GET "/static/:filename.js" (filename)
+ (return
+ `((content-type text/javascript))
+ (call-with-input-file (string-append "static/" filename ".js")
+ read-string)))
(GET "/count" ()
;; (sleep 1)