Debug edge function trigger on cli
I'm trying to trigger a local (cli) edge function using a database webhook trigger, and hope to use the database NEW (payload.record) values inside the edge function.
For the moment, I just want to debug the connection and validate what the webhook sent to the edge function. So I have an edge function that just returns the payload sent by the webhook as a 200 response.
How do I capture this response when called from the webhook (not from the CLI itself)?
One thing that makes me suspicious that it'll work is that the webhook created by the Supabase dashboard doesn't show a payload at all:
create trigger test_trigger after
insert
on
public.ios_apps for each row execute function supabase_functions.http_request('http://127.0.0.1:54321/functions/v1/test_trigger',
'POST',
'{"Content-type":"application/json","Authorization":"Bearer xxxx"}',
'{}',
'5000');
For the moment, I just want to debug the connection and validate what the webhook sent to the edge function. So I have an edge function that just returns the payload sent by the webhook as a 200 response.
How do I capture this response when called from the webhook (not from the CLI itself)?
One thing that makes me suspicious that it'll work is that the webhook created by the Supabase dashboard doesn't show a payload at all:
create trigger test_trigger after
insert
on
public.ios_apps for each row execute function supabase_functions.http_request('http://127.0.0.1:54321/functions/v1/test_trigger',
'POST',
'{"Content-type":"application/json","Authorization":"Bearer xxxx"}',
'{}',
'5000');