about summary refs log tree commit diff stats
path: root/scratch
diff options
context:
space:
mode:
authorelioat <hi@eli.li>2023-12-07 19:47:04 -0500
committerelioat <hi@eli.li>2023-12-07 19:47:04 -0500
commitf6da784d3eb3f9bfc106548e0d3d5db017d7459f (patch)
tree92fc42fe3cd8405d7de57fd03f61b640f4ea4d86 /scratch
parentdc0cecaac05c77769efa7e74ba4ea8e808dbb6a1 (diff)
downloaddecember-2023-f6da784d3eb3f9bfc106548e0d3d5db017d7459f.tar.gz
*
Diffstat (limited to 'scratch')
-rw-r--r--scratch/htmx.scm17
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