diff --git a/apps/docs/pages/guides/functions/examples/upstash-redis.mdx b/apps/docs/pages/guides/functions/examples/upstash-redis.mdx index bbe58dd4dd1..77411c5b1d8 100644 --- a/apps/docs/pages/guides/functions/examples/upstash-redis.mdx +++ b/apps/docs/pages/guides/functions/examples/upstash-redis.mdx @@ -73,7 +73,7 @@ serve(async (_req) => { ```bash supabase start -supabase functions serve upstash-redis-counter --no-verify-jwt --env-file supabase/functions/upstash-redis-counter/.env +supabase functions serve --no-verify-jwt --env-file supabase/functions/upstash-redis-counter/.env ``` Navigate to http://localhost:54321/functions/v1/upstash-redis-counter. diff --git a/apps/docs/pages/guides/functions/local-development.mdx b/apps/docs/pages/guides/functions/local-development.mdx index e342abe9b14..254cad70044 100644 --- a/apps/docs/pages/guides/functions/local-development.mdx +++ b/apps/docs/pages/guides/functions/local-development.mdx @@ -10,7 +10,7 @@ You can run your Edge Function locally using [`supabase functions serve`](/docs/ ```bash supabase start # start the supabase stack -supabase functions serve hello-world # start the Function watcher +supabase functions serve # start the Functions watcher ``` The `functions serve` command has hot-reloading capabilities. It will watch for any changes to your files and restart the Deno server. @@ -20,7 +20,7 @@ The `functions serve` command has hot-reloading capabilities. It will watch for While serving your local Edge Function, you can invoke it using curl: ```bash -curl --request POST 'http://localhost:54321/functions/v1/hello-world' \ +curl --request POST 'http://localhost:54321/functions/v1/function-name' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs' \ --header 'Content-Type: application/json' \ --data '{ "name":"Functions" }' @@ -37,7 +37,7 @@ const supabase = createClient( 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0' ) -const { data, error } = await supabase.functions.invoke('hello-world', { +const { data, error } = await supabase.functions.invoke('function-name', { body: { name: 'Functions' }, }) ``` diff --git a/apps/docs/pages/guides/functions/secrets.mdx b/apps/docs/pages/guides/functions/secrets.mdx index 3d60a239a8b..3487fc94d79 100644 --- a/apps/docs/pages/guides/functions/secrets.mdx +++ b/apps/docs/pages/guides/functions/secrets.mdx @@ -46,7 +46,7 @@ console.log(Deno.env.get('MY_NAME')) Now we can invoke our function locally, by serving it with our new `.env.local` file: ```bash -supabase functions serve hello-world --env-file ./supabase/.env.local +supabase functions serve --env-file ./supabase/.env.local ``` When the function starts you should see the name “Yoda” output to the terminal. diff --git a/spec/cli_v1_commands--old.yaml b/spec/cli_v1_commands--old.yaml index d7af310d127..f3671ceb1ae 100644 --- a/spec/cli_v1_commands--old.yaml +++ b/spec/cli_v1_commands--old.yaml @@ -380,12 +380,12 @@ commands: ``` - id: supabase-functions-serve title: supabase functions serve - summary: Serve a Function locally + summary: Serve Functions locally tags: [] links: [] usage: |- ```sh - supabase functions serve [flags] + supabase functions serve [flags] ``` subcommands: [] options: |- diff --git a/spec/cli_v1_commands.yaml b/spec/cli_v1_commands.yaml index c060b75634e..daf13552001 100644 --- a/spec/cli_v1_commands.yaml +++ b/spec/cli_v1_commands.yaml @@ -761,10 +761,10 @@ commands: flags: [] - id: supabase-functions-serve title: supabase functions serve - summary: Serve a Function locally + summary: Serve all functions locally tags: [] links: [] - usage: supabase functions serve [flags] + usage: supabase functions serve [flags] subcommands: [] flags: - id: env-file diff --git a/spec/common-cli-sections.json b/spec/common-cli-sections.json index 8e5dff89916..127c10a5318 100644 --- a/spec/common-cli-sections.json +++ b/spec/common-cli-sections.json @@ -239,7 +239,7 @@ }, { "id": "supabase-functions-serve", - "title": "Serve a function", + "title": "Serve functions locally", "slug": "supabase-functions-serve", "type": "cli-command" },