1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -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 () => { (async () => {
const httpConn = Deno.serveHttp(conn); const httpConn = Deno.serveHttp(conn);
while (true) { while (true) {
const requestEvent = await httpConn.nextRequest(); try {
if (requestEvent) { const requestEvent = await httpConn.nextRequest();
// ... handle requestEvent ... // ... handle requestEvent ...
} else { } catch (err) {
// the connection has finished // the connection has finished
break; break;
} }