From 33f793bd118dc8ec87f9cfabe223aea847808c29 Mon Sep 17 00:00:00 2001 From: Roj Date: Thu, 27 Jul 2023 09:32:51 +0000 Subject: [PATCH] Fix code examples (#882) * Fix code examples * Fix code examples --- site/docs/es/hosting/fly.md | 4 ++-- site/docs/es/hosting/supabase.md | 1 + site/docs/hosting/fly.md | 4 ++-- site/docs/hosting/supabase.md | 1 + site/docs/id/hosting/fly.md | 4 ++-- site/docs/id/hosting/supabase.md | 1 + site/docs/uk/hosting/fly.md | 4 ++-- site/docs/uk/hosting/supabase.md | 1 + site/docs/zh/hosting/fly.md | 4 ++-- site/docs/zh/hosting/supabase.md | 1 + 10 files changed, 15 insertions(+), 10 deletions(-) diff --git a/site/docs/es/hosting/fly.md b/site/docs/es/hosting/fly.md index 31a22fb4c..4db85efd6 100644 --- a/site/docs/es/hosting/fly.md +++ b/site/docs/es/hosting/fly.md @@ -28,7 +28,7 @@ import { bot } from "./bot.ts"; const port = 8000; const handleUpdate = webhookCallback(bot, "std/http"); -Deno.serve(async (req) => { +Deno.serve({ port }, async (req) => { const url = new URL(req.url); if (req.method === "POST" && url.pathname.slice(1) === bot.token) { try { @@ -38,7 +38,7 @@ Deno.serve(async (req) => { } } return new Response(); -}, { port }); +}); ``` ```ts{10} [Node.js] diff --git a/site/docs/es/hosting/supabase.md b/site/docs/es/hosting/supabase.md index 4db3a8ec5..7aab229d8 100644 --- a/site/docs/es/hosting/supabase.md +++ b/site/docs/es/hosting/supabase.md @@ -58,6 +58,7 @@ Deno.serve(async (req) => { } catch (err) { console.error(err); } + return new Response(); }); ``` diff --git a/site/docs/hosting/fly.md b/site/docs/hosting/fly.md index 9ffdcb8b6..796e19e2f 100644 --- a/site/docs/hosting/fly.md +++ b/site/docs/hosting/fly.md @@ -28,7 +28,7 @@ import { bot } from "./bot.ts"; const port = 8000; const handleUpdate = webhookCallback(bot, "std/http"); -Deno.serve(async (req) => { +Deno.serve({ port }, async (req) => { const url = new URL(req.url); if (req.method === "POST" && url.pathname.slice(1) === bot.token) { try { @@ -38,7 +38,7 @@ Deno.serve(async (req) => { } } return new Response(); -}, { port }); +}); ``` ```ts{10} [Node.js] diff --git a/site/docs/hosting/supabase.md b/site/docs/hosting/supabase.md index c438167a0..68756f9e1 100644 --- a/site/docs/hosting/supabase.md +++ b/site/docs/hosting/supabase.md @@ -58,6 +58,7 @@ Deno.serve(async (req) => { } catch (err) { console.error(err); } + return new Response(); }); ``` diff --git a/site/docs/id/hosting/fly.md b/site/docs/id/hosting/fly.md index 23911eb46..ef60c159f 100644 --- a/site/docs/id/hosting/fly.md +++ b/site/docs/id/hosting/fly.md @@ -28,7 +28,7 @@ import { bot } from "./bot.ts"; const port = 8000; const handleUpdate = webhookCallback(bot, "std/http"); -Deno.serve(async (req) => { +Deno.serve({ port }, async (req) => { const url = new URL(req.url); if (req.method === "POST" && url.pathname.slice(1) === bot.token) { try { @@ -38,7 +38,7 @@ Deno.serve(async (req) => { } } return new Response(); -}, { port }); +}); ``` ```ts{10} [Node.js] diff --git a/site/docs/id/hosting/supabase.md b/site/docs/id/hosting/supabase.md index 34194c89b..5d28c4bf6 100644 --- a/site/docs/id/hosting/supabase.md +++ b/site/docs/id/hosting/supabase.md @@ -62,6 +62,7 @@ Deno.serve(async (req) => { } catch (err) { console.error(err); } + return new Response(); }); ``` diff --git a/site/docs/uk/hosting/fly.md b/site/docs/uk/hosting/fly.md index 3ee814ebe..9d7b425d0 100644 --- a/site/docs/uk/hosting/fly.md +++ b/site/docs/uk/hosting/fly.md @@ -28,7 +28,7 @@ import { bot } from "./bot.ts"; const port = 8000; const handleUpdate = webhookCallback(bot, "std/http"); -Deno.serve(async (req) => { +Deno.serve({ port }, async (req) => { const url = new URL(req.url); if (req.method === "POST" && url.pathname.slice(1) === bot.token) { try { @@ -38,7 +38,7 @@ Deno.serve(async (req) => { } } return new Response(); -}, { port }); +}); ``` ```ts{10} [Node.js] diff --git a/site/docs/uk/hosting/supabase.md b/site/docs/uk/hosting/supabase.md index 66fc8aefe..6526f2e04 100644 --- a/site/docs/uk/hosting/supabase.md +++ b/site/docs/uk/hosting/supabase.md @@ -58,6 +58,7 @@ Deno.serve(async (req) => { } catch (err) { console.error(err); } + return new Response(); }); ``` diff --git a/site/docs/zh/hosting/fly.md b/site/docs/zh/hosting/fly.md index dcbeee944..68b9c7a4b 100644 --- a/site/docs/zh/hosting/fly.md +++ b/site/docs/zh/hosting/fly.md @@ -28,7 +28,7 @@ import { bot } from "./bot.ts"; const port = 8000; const handleUpdate = webhookCallback(bot, "std/http"); -Deno.serve(async (req) => { +Deno.serve({ port }, async (req) => { const url = new URL(req.url); if (req.method === "POST" && url.pathname.slice(1) === bot.token) { try { @@ -38,7 +38,7 @@ Deno.serve(async (req) => { } } return new Response(); -}, { port }); +}); ``` ```ts{10} [Node.js] diff --git a/site/docs/zh/hosting/supabase.md b/site/docs/zh/hosting/supabase.md index 39f031ffd..d1d459a98 100644 --- a/site/docs/zh/hosting/supabase.md +++ b/site/docs/zh/hosting/supabase.md @@ -58,6 +58,7 @@ Deno.serve(async (req) => { } catch (err) { console.error(err); } + return new Response(); }); ```