mirror of
https://github.com/denoland/deno.git
synced 2024-11-23 15:16:54 -05:00
80b2067030
Original: 9377d154c5
21 lines
400 B
TypeScript
21 lines
400 B
TypeScript
import { serve } from "./http.ts";
|
|
//import { test } from "https://deno.land/x/testing/testing.ts";
|
|
|
|
const addr = "0.0.0.0:8000";
|
|
const s = serve(addr);
|
|
console.log(`listening on http://${addr}/`);
|
|
|
|
async function main() {
|
|
for await (const req of s) {
|
|
console.log("Req", req);
|
|
req.respond({ body: "Hello World\n" });
|
|
}
|
|
}
|
|
|
|
main();
|
|
|
|
/*
|
|
test(function basic() {
|
|
console.log("ok");
|
|
});
|
|
*/
|