1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

docs(runtime): fix HTTP server example (#11047)

This commit is contained in:
vwkd 2021-06-19 20:00:30 +02:00 committed by GitHub
parent 60071c941b
commit 7b559ee89e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,10 +127,10 @@ while (true) {
(async () => {
const httpConn = Deno.serveHttp(conn);
while (true) {
const requestEvent = await httpConn.nextRequest();
if (requestEvent) {
try {
const requestEvent = await httpConn.nextRequest();
// ... handle requestEvent ...
} else {
} catch (err) {
// the connection has finished
break;
}