summaryrefslogtreecommitdiff
path: root/http_test.ts
blob: 1b16b0f0a17afc651795e972ac420e575b25828b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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");
});
  */