1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-23 23:49:46 -05:00
denoland-deno/std/http/testdata/simple_server.ts

11 lines
382 B
TypeScript
Raw Normal View History

// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
// This is an example of a server that responds with an empty body
import { serve } from "../server.ts";
const port = parseInt(Deno.args[0] || "4502");
const addr: Deno.ListenOptions = { port };
console.log(`Simple server listening on ${port}`);
2019-10-27 06:04:42 -07:00
for await (const req of serve(addr)) {
req.respond({});
}