summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/error_for_await.ts
blob: 6e8c5203f4532adb25ac54168aab6d8850a67bd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const listener = Deno.listen({ port: 8080 });

for await (const conn of listener) {
  handleConn(conn);
}

function handleConn(conn: Deno.Conn) {
  const httpConn = Deno.serveHttp(conn);
  for await (const event of httpConn) {
    event.respondWith(new Response("html", { status: 200 }));
  }
}

export {};