racket/collects/web-server/default-web-root/htdocs/Defaults/documentation/examples/count.ss
Jay McCarthy bb1f188642 pr8515
svn: r5561
2007-02-06 14:46:06 +00:00

15 lines
463 B
Scheme

(require (lib "unit.ss")
(lib "servlet-sig.ss" "web-server")
(lib "date.ss"))
(let ([count 0]
[date (date->string (seconds->date (current-seconds)) 'time-too)])
(unit (import servlet^)
(export)
(set! count (add1 count))
`(html (head (title "Counter"))
(body ([bgcolor "white"])
(p "This servlet was called " ,(number->string count)
" times since loaded on " ,date ".")))))