forked from anime-vsub/app
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1f9647
commit afc4ef5
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Follow this setup guide to integrate the Deno language server with your editor: | ||
// https://deno.land/manual/getting_started/setup_your_environment | ||
// This enables autocomplete, go to definition, etc. | ||
|
||
// Setup type definitions for built-in Supabase Runtime APIs | ||
/// <reference types="https://esm.sh/@supabase/functions-js/src/edge-runtime.d.ts" /> | ||
Check failure on line 6 in supabase/functions/upsert_user/index.ts GitHub Actions / Analyze (javascript)
|
||
|
||
console.log("Hello from Functions!") | ||
|
||
Deno.serve(async (req) => { | ||
Check failure on line 10 in supabase/functions/upsert_user/index.ts GitHub Actions / Analyze (javascript)
Check failure on line 10 in supabase/functions/upsert_user/index.ts GitHub Actions / Analyze (javascript)
Check failure on line 10 in supabase/functions/upsert_user/index.ts GitHub Actions / typing
|
||
const { name } = await req.json() | ||
const data = { | ||
message: `Hello ${name}!`, | ||
} | ||
|
||
return new Response( | ||
JSON.stringify(data), | ||
{ headers: { "Content-Type": "application/json" } }, | ||
) | ||
}) | ||
|
||
/* 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:54321/functions/v1/upsert_user' \ | ||
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{"name":"Functions"}' | ||
*/ |