mirror of
https://github.com/denoland/deno.git
synced 2024-11-23 15:16:54 -05:00
17c255581d
Original: 1bf555ab2f
22 lines
430 B
TypeScript
22 lines
430 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}/`);
|
|
|
|
const body = new TextEncoder().encode("Hello World\n");
|
|
|
|
async function main() {
|
|
for await (const req of s) {
|
|
await req.respond({ status: 200, body });
|
|
}
|
|
}
|
|
|
|
main();
|
|
|
|
/*
|
|
test(function basic() {
|
|
console.log("ok");
|
|
});
|
|
*/
|