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:
parent
60071c941b
commit
7b559ee89e
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue