diff --git a/native_http_server.dart b/native_http_server.dart new file mode 100644 index 0000000..d344a7c --- /dev/null +++ b/native_http_server.dart @@ -0,0 +1,10 @@ +// deno --unstable native_http_server.dart +const body = new TextEncoder().encode("Hello World"); +for await (const conn of Deno.listen({ port: 4500 })) { + (async () => { + for await (const { respondWith } of Deno.serveHttp(conn)) { + respondWith(new Response(body)); + } + })(); +} +