Cloudflare
Deploy a Worker with D1, apply remote migrations and schedule checks.
These instructions assume a project created with create-heyo-status and
the Cloudflare deployment option. The starter serves the page and API from a
Worker, stores check history in D1 and uses cron triggers for checks, daily
summaries and cleanup. It supports React Router, Next.js (OpenNext) and Astro.
Workers cannot run TCP or TLS monitors; use HTTP and DNS checks here.
Create the project and D1 database
This example uses React Router. Change react-router to next or astro for
a different framework. The Quickstart
shows creator commands for other package managers; the generated scripts still
require Bun 1.4.3+.
Copy the database_id printed by Wrangler into wrangler.jsonc in place of
"replace-me". Keep the generated DB binding and migrations_dir:
heyo-status.config.ts reads that binding, and Wrangler reads SQL files
from migrations/. There is no SQLite fallback if the binding is missing.
Develop locally with D1
The generated dev script applies local D1 migrations and starts the
framework development server with a local D1 binding. Edit theme in
heyo-status.config.ts and the open page updates without restarting bun dev.
Local D1 is separate from your remote database. The public page may have no
check history until a check is triggered; the development server does not run
Worker cron triggers.
To test the built Worker locally instead, run bun run start. It builds
the app and serves it with Wrangler; restart this command after code changes.
Updating @heyo-sh/create-heyo-status does not rewrite existing generated
projects. If your project's dev script still builds and runs wrangler dev,
it will continue to require a restart until you adopt the updated Cloudflare
starter files, not just a newer generator package.
Replace the example example.com monitors with your own HTTP or DNS targets.
In heyo-status.config.ts, set the public URL used in feeds and emails:
Migrate remote D1, then deploy
Running bun dev does not migrate the remote database. Apply its SQL
migrations before the first release and whenever new migration files are
added, then deploy the Worker:
The project name in the migration command must match database_name in
wrangler.jsonc. Updating the package alone does not add new SQL files to an
existing generated project's migrations/ folder; see the
D1 migration guide before
upgrading.
Keep the three expressions in wrangler.jsonc aligned with
checks.interval, checks.summaryCron and checks.cleanupCron in the
config. The Worker matches the exact incoming cron expression to a job;
a trigger changed in only one file runs no matching job. Cron triggers run in
Cloudflare after deployment, not as part of bun run deploy.
Check the deployment
/healthz only confirms that the API responds. /status/summary also needs
the database; check hasConfig and hasData in its response. If hasData is
false immediately after deployment, wait for the first scheduled run (or use
the admin check endpoint if you
have enabled it). An unbound D1 or missing migrations will not be caught by
/healthz alone.
The management API stays closed until you set adminToken. If you enable it,
load the token from a private Worker secret explicitly in your integration:
heyoStatus() does not read Wrangler secrets automatically. Public reads do
not require an admin token.
See Checks and scheduling for the three jobs and platform frequency limits.