11 lines
341 B
TypeScript
11 lines
341 B
TypeScript
import { serve } from "https://deno.land/std/http/server.ts";
|
|
|
|
window.onload = async function() {
|
|
console.log('Start listen :8000 ...');
|
|
const body = new TextEncoder().encode("Hello World\n");
|
|
for await (const req of serve(":8000")) {
|
|
console.log('Received request: ' + JSON.stringify(req.conn));
|
|
req.respond({ body });
|
|
}
|
|
};
|