#lang scheme/base ;; Example code for a simple web server that just counts ;; the number of times it's been called. (require web-server/web-server (prefix-in lift: web-server/dispatchers/dispatch-lift)) (define (start-server) (serve #:dispatch (lift:make my-responder) #:port 6402)) (define n 0) (define (my-responder request) (set! n (add1 n)) `(html (head (title "Hello World!")) (body (h1 "Nothing to see here") (p ,(format "I've been visited ~a times since starting up." n)) (p "Go back to: " (a ((href "http://hashcollision.org")) "http://hashcollision.org") ".")))) ;; Toplevel: just start the server and then wait for the end. (begin (start-server) (do-not-return))