mirror of
https://github.com/denoland/deno.git
synced 2024-10-31 09:14:20 -04:00
12 lines
284 B
TypeScript
12 lines
284 B
TypeScript
const listener = Deno.listen({
|
|
port: Number(Deno.args[0]),
|
|
});
|
|
|
|
console.log("READY");
|
|
|
|
for await (const conn of listener) {
|
|
for await (const { request, respondWith } of Deno.serveHttp(conn)) {
|
|
const href = new URL(request.url).href;
|
|
respondWith(new Response(href));
|
|
}
|
|
}
|