C:\> deno run --allow-net single_request.tsC:\> curl -i localhost
HTTP/1.1 200 OK
content-type: text/plain;charset=UTF-8
content-length: 0
date: Thu, 09 Sep 2021 13:29:34 GMT| eof: for await (const conn of Deno.listen({ port: 80 })) { | |
| for await (const event of Deno.serveHttp(conn)) { | |
| event.respondWith(new Response("")); | |
| break eof; | |
| } | |
| } |
| const listener = Deno.listen({ port: 80 }); | |
| const conn = await listener.accept(); | |
| const httpConn = Deno.serveHttp(conn); | |
| const event = await httpConn.nextRequest(); | |
| event!.respondWith(new Response("")); |