How to set up an HTTP server with a very simple answer in Racket?

The official Racket Docs have too many details with specific string handling, so I'm struggling. What would be the easiest way to set up a basic web server that accepts an HTTP GET request and returns HTML to Racket? Preferred with # lang / insta web server?

+4
source share
1 answer

Tutorial Continue: Web applications in Racket provide an example of how to do this at the very beginning (Section 1, “Getting Started”).

In short, enter the following into DrRacket and click Run. (And click on the stop to kill the server). Hope this helps you get started.

#lang web-server/insta
(define (start request)
  (response/xexpr
   '(html
     (head (title "My Blog"))
     (body (h1 "Under construction")))))
+3
source

All Articles