mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
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.
This commit is contained in:
parent
f0993f413b
commit
4ef08a58df
8 changed files with 253 additions and 148 deletions
|
@ -7,4 +7,4 @@ const [hostname, port] = addr.split(":");
|
|||
const app = new Hono();
|
||||
app.get("/", (c) => c.text("Hello, World!"));
|
||||
|
||||
Deno.serve({ fetch: app.fetch, port: Number(port), hostname });
|
||||
Deno.serve(app.fetch, { port: Number(port), hostname });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue