deno/cli/bench/http/deno_http_serve.js

12 lines
319 B
JavaScript
Raw Normal View History

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
const addr = Deno.args[0] ?? "127.0.0.1:4500";
const [hostname, port] = addr.split(":");
const { serve } = Deno;
function handler() {
return new Response("Hello World");
}
2023-06-24 08:36:15 +00:00
serve({ hostname, port: Number(port), reusePort: true }, handler);