1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-14 16:33:45 -05:00
denoland-deno/cli/tests/testdata/error_for_await.ts
2021-09-17 16:54:52 +10:00

14 lines
307 B
TypeScript

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 {};