From bd973f069a4c0d5f2ce3ce8a73d89a39e9524fe3 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 10 Apr 2024 15:40:32 +0200 Subject: [PATCH] Direct response example in http-server.rkt --- syndicate-examples/http-server.rkt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/syndicate-examples/http-server.rkt b/syndicate-examples/http-server.rkt index 69299c2..c44a0ea 100644 --- a/syndicate-examples/http-server.rkt +++ b/syndicate-examples/http-server.rkt @@ -52,4 +52,15 @@ `(h1 "Second page") `(a ((href "/")) "Go back"))))) + (spawn #:name 'server2 + (at ds + (assert (HttpBinding #f 8080 'get (list (PathPatternElement-label "page3")) + (object + [(HttpContext req res) + (at res + (log-info "+page3") + (on-stop (log-info "-page3")) + (send! (HttpResponse-header 'content-type "text/plain")) + (send! (HttpResponse-done "this is page3\n")))]))))) + )))