add hello_server.ts
This commit is contained in:
10
single_file_tests/hello_server.ts
Normal file
10
single_file_tests/hello_server.ts
Normal file
@@ -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 });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user