File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Examples/supabase/functions/hello-world Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -96,3 +96,4 @@ iOSInjectionProject/
96
96
/.swiftpm
97
97
98
98
Secrets.swift
99
+ .env
Original file line number Diff line number Diff line change
1
+ // Follow this setup guide to integrate the Deno language server with your editor:
2
+ // https://deno.land/manual/getting_started/setup_your_environment
3
+ // This enables autocomplete, go to definition, etc.
4
+
5
+ import { serve } from "https://deno.land/[email protected] /http/server.ts"
6
+
7
+ console . log ( "Hello from Functions!" )
8
+
9
+ serve ( async ( req ) => {
10
+ const { name } = await req . json ( )
11
+ const data = {
12
+ message : `Hello ${ name } !` ,
13
+ }
14
+
15
+ return new Response (
16
+ JSON . stringify ( data ) ,
17
+ { headers : { "Content-Type" : "application/json" } } ,
18
+ )
19
+ } )
20
+
21
+ // To invoke:
22
+ // curl -i --location --request POST 'http://localhost:54321/functions/v1/' \
23
+ // --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0' \
24
+ // --header 'Content-Type: application/json' \
25
+ // --data '{"name":"Functions"}'
You can’t perform that action at this time.
0 commit comments