2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2024-06-05 00:09:29 +01:00
|
|
|
|
|
|
|
// deno-lint-ignore-file no-deprecated-deno-api
|
|
|
|
|
2021-07-28 13:12:45 +02:00
|
|
|
const listener = Deno.listen({ hostname: "127.0.0.1", port: 4506 });
|
2021-04-21 22:02:11 -04:00
|
|
|
postMessage("ready");
|
2021-04-20 19:56:31 +05:30
|
|
|
for await (const conn of listener) {
|
|
|
|
(async () => {
|
2024-09-06 08:15:00 +10:00
|
|
|
// @ts-ignore `Deno.serveHttp()` was soft-removed in Deno 2.
|
2021-04-20 19:56:31 +05:30
|
|
|
const requests = Deno.serveHttp(conn);
|
|
|
|
for await (const { respondWith } of requests) {
|
|
|
|
respondWith(new Response("Hello world"));
|
|
|
|
}
|
|
|
|
})();
|
|
|
|
}
|