Astro
Mount the endpoint, hydrate the island and schedule checks in an Astro app.
Astro serves the API as a catch-all endpoint and the page as a React island. The adapter imports no Astro package, so the handler module stays portable.
Astro 7 requires Node.js 22.12+ for local builds and Node deployments.
Project shape
my-status-page
- heyo-status.config.ts
- heyo-status.database.ts
- astro.config.mjs
src
pages
- index.astro
api/heyo-status
- [...path].ts
styles
- status.css
The API endpoint
prerender = false is required: the endpoint must run per request, not at
build time.
Astro configuration
Astro's origin check rejects every DELETE without a JSON
content-type and the unsubscribe confirmation form. The status API
authenticates with a bearer token and holds no cookie or session authority,
so the check adds no protection here and only breaks valid clients.
The page
client:load matters: the page renders fine without it, but the colour-mode
toggle and the subscribe dialog would be inert markup.
Scripts
Deployment notes
| Target | Notes |
|---|---|
| Cloudflare Workers | Uses @astrojs/cloudflare with src/status-worker.ts. bun dev builds and boots the real Worker; there is no framework hot reload, so restart after changing code. |
| Vercel | Adds src/pages/api/cron/[task].ts and vercel.json with three cron entries. |
| Node | output: "server" with @astrojs/node in standalone mode, Node.js 22.12+. |
On Cloudflare, tcp and ssl monitors are unavailable; use http and dns,
or run certificate checks from a Node host.