mirror of
https://github.com/denoland/deno.git
synced 2024-10-31 09:14:20 -04:00
13 lines
295 B
TypeScript
13 lines
295 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 }));
|
||
|
}
|
||
|
}
|