mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
7937ae3f2f
Towards #22079 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
12 lines
304 B
TypeScript
12 lines
304 B
TypeScript
const listener = Deno.listen({ port: 8080 });
|
|
|
|
for await (const conn of listener) {
|
|
handleConn(conn);
|
|
}
|
|
|
|
function handleConn(conn: Deno.Conn) {
|
|
const httpConn = (Deno as any).serveHttp(conn);
|
|
for await (const event of httpConn) {
|
|
event.respondWith(new Response("html", { status: 200 }));
|
|
}
|
|
}
|