1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-12 02:27:46 -05:00
denoland-deno/tests/specs/serve/basic/main.ts
2024-09-12 23:32:28 +00:00

18 lines
353 B
TypeScript

(async () => {
for (let i = 0; i < 1000; i++) {
try {
const resp = await fetch("http://localhost:12345/");
Deno.exit(0);
} catch {
await new Promise((r) => setTimeout(r, 10));
}
}
Deno.exit(2);
})();
export default {
fetch(req) {
return new Response("Hello world!");
},
} satisfies Deno.ServeDefaultExport;