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