diff --git a/src/pages/health.ts b/src/pages/health.ts new file mode 100644 index 0000000..2924ec5 --- /dev/null +++ b/src/pages/health.ts @@ -0,0 +1,24 @@ +import type { APIRoute } from "astro"; +export const prerender = false; + +export const GET: APIRoute = async () => { + try { + return new Response( + JSON.stringify({ + status: "pass", + timestamp: new Date().toISOString(), + }), + { + status: 200, + }, + ); + } catch { + return new Response( + JSON.stringify({ + status: "fail", + timestamp: new Date().toISOString(), + }), + { status: 500 }, + ); + } +};