inicio de funcion de generación de asignatura

This commit is contained in:
2026-02-04 16:35:28 -06:00
parent e5657d6b0f
commit 7660d2c3a0
5 changed files with 54 additions and 24 deletions
@@ -0,0 +1,25 @@
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
import { corsHeaders } from "../_shared/cors.ts";
console.log("Hello from Functions!");
Deno.serve(async (req) => {
const url = new URL(req.url);
const functionName = url.pathname.split("/").pop();
console.log(
`[${new Date().toISOString()}][${functionName}]: Request received`,
);
if (req.method === "OPTIONS") {
return new Response(null, { status: 204, headers: corsHeaders });
}
const { name } = await req.json();
const data = {
message: `Hello ${name}!`,
};
return new Response(
JSON.stringify(data),
{ headers: { "Content-Type": "application/json" } },
);
});