public
Last active

  • Download Gist
main.rkt
Racket
1 2 3 4 5 6 7 8 9 10 11 12
#lang web-server/insta
 
(require web-server/templates)
 
(define (start req)
(let ([some-input
(if (exists-binding? 'some-input (request-bindings req))
(extract-binding/single 'some-input (request-bindings req))
"nothing yet")])
(response/full 200 #"Okay" (current-seconds) TEXT/HTML-MIME-TYPE
empty
(list (string->bytes/utf-8 (include-template "static.htm"))))))
static.htm
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<!DOCTYPE html>
<html>
<head>
<title>Testing</title>
</head>
<body>
<h1>You said: @|some-input|</h1>
 
<form method="get" action="#">
<input name="some-input" type="text" />
<input type="submit" />
</form>
</body>
</html>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.