first commit

This commit is contained in:
the committed 2026-10-29 13:33:18 +08:00
commit 0b5c823408
89 files changed
+54090

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
// Public, credential-free, stateless endpoint; independent of the mapped physical function name.
export function handler(request: Request): Response {
const headers = { "Cache-Control": "no-store" };
if (request.method !== "GET") {
return Response.json(
{ ok: false, error: "method_not_allowed" },
{ status: 405, headers: { ...headers, Allow: "GET" } },
);
}
const name = new URL(request.url).searchParams.get("name")?.trim() ?? "Visitor";
if (!name || name.length > 80) {
return Response.json({ ok: false, error: "invalid_name" }, { status: 400, headers });
}
return Response.json({ ok: true, message: `Hello, ${name}!` }, { headers });
}
+3
View File
@@ -0,0 +1,3 @@
import { handler } from "./handler.ts";
Deno.serve(handler);