1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-29 02:29:06 -05:00
denoland-deno/http/http_bench.ts

16 lines
382 B
TypeScript
Raw Normal View History

2019-02-07 11:45:47 -05:00
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
2019-02-24 16:53:13 -05:00
import { serve } from "./server.ts";
2018-12-06 17:19:12 -05:00
const addr = Deno.args[1] || "127.0.0.1:4500";
2018-12-06 17:19:12 -05:00
const server = serve(addr);
const body = new TextEncoder().encode("Hello World");
async function main(): Promise<void> {
for await (const request of server) {
request.respond({ status: 200, body });
2018-12-06 17:19:12 -05:00
}
}
main();