From 4ef08a58dfbcf893f25fd59917aa946f455e85f2 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 24 Aug 2022 00:08:56 +0200 Subject: feat: update `Deno.serve` function signature (#15563) This commit changes the `Deno.serve` function signature to be more versatile and easier to use. It is now a drop in replacement for std/http's `serve`. The input validation has also been reworked. --- cli/bench/http/deno_http_flash.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'cli/bench/http/deno_http_flash.js') diff --git a/cli/bench/http/deno_http_flash.js b/cli/bench/http/deno_http_flash.js index 3823bb9cd..7c486f422 100644 --- a/cli/bench/http/deno_http_flash.js +++ b/cli/bench/http/deno_http_flash.js @@ -4,12 +4,8 @@ const addr = Deno.args[0] || "127.0.0.1:4500"; const [hostname, port] = addr.split(":"); const { serve } = Deno; -function fetch() { +function handler() { return new Response("Hello World"); } -serve({ - fetch, - hostname, - port, -}); +serve(handler, { hostname, port }); -- cgit v1.2.3