diff options
author | elioat <hi@eli.li> | 2023-12-07 19:47:04 -0500 |
---|---|---|
committer | elioat <hi@eli.li> | 2023-12-07 19:47:04 -0500 |
commit | f6da784d3eb3f9bfc106548e0d3d5db017d7459f (patch) | |
tree | 92fc42fe3cd8405d7de57fd03f61b640f4ea4d86 /scratch | |
parent | dc0cecaac05c77769efa7e74ba4ea8e808dbb6a1 (diff) | |
download | december-2023-f6da784d3eb3f9bfc106548e0d3d5db017d7459f.tar.gz |
*
Diffstat (limited to 'scratch')
-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 |