(body: unknown, status = 200)
| 7 | }; |
| 8 | |
| 9 | function json(body: unknown, status = 200) { |
| 10 | return new Response(JSON.stringify(body), { |
| 11 | status, |
| 12 | headers: { ...corsHeaders, "Content-Type": "application/json" }, |
| 13 | }); |
| 14 | } |
| 15 | |
| 16 | serve(async (req) => { |
| 17 | if (req.method === "OPTIONS") return new Response(null, { headers: corsHeaders }); |