const API_PORT = process.env.PORT_API ?? "3001"; const WEB_PORT = process.env.PORT_WEB ?? "3100"; export default async function smokeA() { const healthRes = await fetch(`http://localhost:${API_PORT}/health`); if (healthRes.status !== 200) { throw new Error(`GET /health 回傳 ${healthRes.status},預期 200`); } const healthBody = await healthRes.json(); if (healthBody.status !== "ok") { throw new Error("GET /health 回應內容缺少 status: ok"); } const homeRes = await fetch(`http://localhost:${WEB_PORT}/`); if (homeRes.status !== 200) { throw new Error(`web 首頁回傳 ${homeRes.status},預期 200`); } const homeHtml = await homeRes.text(); if (!homeHtml.includes("心音")) { throw new Error("web 首頁內容缺少「心音」字樣"); } }