diff options
Diffstat (limited to 'scratch/htmx.scm')
-rw-r--r-- | scratch/htmx.scm | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/scratch/htmx.scm b/scratch/htmx.scm index fd4696d..7ffb7e7 100644 --- a/scratch/htmx.scm +++ b/scratch/htmx.scm @@ -1,8 +1,6 @@ #! /usr/bin/env chibi-scheme ; Simple HTTP server -; Returns a minimal HTML page with a single number incremented -; every request. Binds to localhost port 8000. (import (chibi) @@ -10,11 +8,18 @@ (chibi net servlet) (chibi sxml)) +(define config-port 8000) + (let ((count 0)) (run-http-server - 8000 + config-port (lambda (cfg request next restart) (set! count (+ 1 count)) - (servlet-write request (sxml->xml `(html (body - (p "Count: \n") - (p ,count)))))))) \ No newline at end of file + (servlet-write request + (sxml->xml + `(html + (head + (title "counter")) + (body + (h1 "Count: ") + (p ,count)))))))) \ No newline at end of file |