aboutsummaryrefslogtreecommitdiff
path: root/module/entry-points/server.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-09 16:52:15 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-09 16:52:15 +0200
commit4126e78f84b3d1cd407002a271b778e213ee9362 (patch)
tree5f13f6f1f5de8cf735e7260ebdb7df58c228c794 /module/entry-points/server.scm
parentReplace xcal main with ns-wrap. (diff)
downloadcalp-4126e78f84b3d1cd407002a271b778e213ee9362.tar.gz
calp-4126e78f84b3d1cd407002a271b778e213ee9362.tar.xz
Attempt to serve everything as xml.
Diffstat (limited to 'module/entry-points/server.scm')
-rw-r--r--module/entry-points/server.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm
index 0698daf0..398cda6b 100644
--- a/module/entry-points/server.scm
+++ b/module/entry-points/server.scm
@@ -68,12 +68,14 @@
(return '((content-type text/html))
(sxml->html-string '(a (@ (href "/today")) "Gå till idag"))))
- (GET "/week/:start-date.html" (start-date)
+ (GET "/week/:start-date.:ext" (start-date ext)
(let* ((start-date
(start-of-week (parse-iso-date start-date)
(get-config 'week-start))))
- (return '((content-type text/html))
+ (return `((content-type ,(if (string=? ext "xml")
+ 'application/xhtml+xml
+ 'text/html)))
(with-output-to-string
(lambda ()
(html-generate calendars: (getf 'calendars)