diff --git a/single_file_tests/hello_server.ts b/single_file_tests/hello_server.ts new file mode 100644 index 0000000..bae6ffd --- /dev/null +++ b/single_file_tests/hello_server.ts @@ -0,0 +1,10 @@ +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 }); + } +};