2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2024-06-04 19:09:29 -04:00
|
|
|
|
|
|
|
// deno-lint-ignore-file no-deprecated-deno-api
|
|
|
|
|
2021-07-28 07:12:45 -04: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 10:26:31 -04:00
|
|
|
for await (const conn of listener) {
|
|
|
|
(async () => {
|
2024-09-05 18:15:00 -04:00
|
|
|
// @ts-ignore `Deno.serveHttp()` was soft-removed in Deno 2.
|
2021-04-20 10:26:31 -04:00
|
|
|
const requests = Deno.serveHttp(conn);
|
|
|
|
for await (const { respondWith } of requests) {
|
|
|
|
respondWith(new Response("Hello world"));
|
|
|
|
}
|
|
|
|
})();
|
|
|
|
}
|