From 8f834686a150216a60660c4a0e1ebc6ddf09b9f7 Mon Sep 17 00:00:00 2001 From: Wen Bo Xie Date: Wed, 15 Nov 2023 14:34:35 -0800 Subject: [PATCH] feat: add cli instructions to invoke functions locally --- internal/functions/new/templates/index.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/internal/functions/new/templates/index.ts b/internal/functions/new/templates/index.ts index a278f6e1e..eec03f555 100644 --- a/internal/functions/new/templates/index.ts +++ b/internal/functions/new/templates/index.ts @@ -16,8 +16,14 @@ Deno.serve(async (req) => { ) }) -// To invoke locally: -// curl -i --location --request POST 'http://127.0.0.1:{{ .Port }}/functions/v1/{{ .Slug }}' \ -// --header 'Authorization: Bearer {{ .Token }}' \ -// --header 'Content-Type: application/json' \ -// --data '{"name":"Functions"}' +/* To invoke locally: + + 1. Run `supabase start` (see: https://supabase.com/docs/reference/cli/supabase-start) + 2. Make an HTTP request: + + curl -i --location --request POST 'http://127.0.0.1:{{ .Port }}/functions/v1/{{ .Slug }}' \ + --header 'Authorization: Bearer {{ .Token }}' \ + --header 'Content-Type: application/json' \ + --data '{"name":"Functions"}' + +*/