import { getRequestURL } from "h3"; import { isCloudProbePath } from "#server/constants/cloud-probes"; const METHODS = new Set(["GET", "HEAD"]); export default eventHandler((event) => { if (!METHODS.has(event.method)) return; const pathname = getRequestURL(event).pathname; if (!isCloudProbePath(pathname)) return; setHeader(event, "content-type", "text/plain; charset=utf-8"); setHeader( event, "cache-control", "no-store, no-cache, must-revalidate, proxy-revalidate", ); if (event.method === "HEAD") { setResponseStatus(event, 200); return; } return "OK"; });