Reputation: 497
The official Racket Docs go into too much detail with specific string processing, so I'm struggling. What would be the easiest way to set up a basic web server that accepts a HTTP GET Request and returns HTML in Racket? Preferably with #lang web-server/insta?
Upvotes: 4
Views: 577
Reputation: 22342
The tutorial Continue: Web Applications in Racket has an example of how to do this at the very beginning (Section 1, Getting Started).
Long story short, type the following into DrRacket and hit run. (And hit stop to kill the server). Hopefully that helps you get started.
#lang web-server/insta
(define (start request)
(response/xexpr
'(html
(head (title "My Blog"))
(body (h1 "Under construction")))))
Upvotes: 3