Next.js
Mount the App Router route, render the page and schedule checks.
The adapter returns the five method exports an App Router route handler needs. No Next package is imported by Heyo Status, so the module stays safe in every runtime.
Project shape
my-status-page
- heyo-status.config.ts
- heyo-status.database.ts
app
- layout.tsx
- page.tsx
api/heyo-status/[...path]
- route.ts
styles
- status.css
- next.config.mjs
The API route
The simpler form works when the configuration can be imported statically:
The generated template uses the dynamic form so an embedded SQLite adapter is never constructed during Next's static analysis.
The page
A status page must reflect the last check, not the last build. Without
export const dynamic = "force-dynamic" Next will happily serve
a statically rendered snapshot from deploy time.
Root layout
Scripts
Deployment notes
| Target | What the overlay adds |
|---|---|
| Cloudflare Workers | OpenNext config, worker/status-worker.ts binding D1 and forwarding scheduled, wrangler.jsonc with three cron triggers. |
| Vercel | app/api/cron/[task]/route.ts guarded by CRON_SECRET, plus vercel.json. |
| Self-hosted | next start on Node.js 20.19+, with node-cron or an external scheduler. |
On Workers, node:net and node:tls are unavailable, so tcp and ssl
monitors report as unsupported. On Node, keep the runtime at 20.19 or newer
so process.getBuiltinModule can resolve them.