mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
Add health check edge function (#26823)
This commit is contained in:
1 parent
97853287f3
commit
65eb68b0ee
1 file changed
+21
@@ -0,0 +1,21 @@
|
||||
import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
|
||||
|
||||
serve(async (req) => {
|
||||
const data = { healthy: true };
|
||||
const corsHeaders = {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Access-Control-Allow-Methods": "POST",
|
||||
"Access-Control-Allow-Headers":
|
||||
"authorization, x-request-id, apikey, content-type, user-agent, sec-ch-ua, sec-ch-ua-mobile, sec-ch-ua-platform, referer, accept",
|
||||
};
|
||||
|
||||
// This is needed if you're planning to invoke your function from a browser.
|
||||
if (req.method === "OPTIONS") {
|
||||
return new Response("ok", { headers: corsHeaders });
|
||||
}
|
||||
|
||||
return new Response(JSON.stringify(data), {
|
||||
headers: { ...corsHeaders, "Content-Type": "application/json" },
|
||||
status: 200,
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user