platform-archive/app-canary.canary-a2c9
Public: anyone can read this; nobody can change it.
Archived from git.open-platform.sh/app-canary/canary-a2c9 (retired Forgejo), 2026-11-13.
Archived on
Something wrong? Report a problem, no account needed.
This repository has no app yet.
- .forgejo
- .playwright-mcp
- charts
- scripts
- src
- .gitignore 223 B · ~64 tok
- .prettierignore 27 B · ~8 tok
- biome.json 674 B · ~225 tok
- canary-preview.png 36.9 KB
- Dockerfile 1.1 KB · ~311 tok
- package-lock.json 77.9 KB · ~27k tok
- package.json 1.1 KB · ~385 tok
- PLAN.md 2.2 KB · ~569 tok
- README.md 2.8 KB · ~710 tok
- tsconfig.json 363 B · ~121 tok
README.md
canary-a2c9
A deployment canary: a single page that tells you, at a glance, that the app
is live and which build is serving. It shows a big green canary ok, the
build timestamp of the running image, the version, when the process started,
and a live uptime — plus a short history of recent boots so you can see deploys
roll through over time.
Live: https://canary-a2c9-app-canary.open-platform.sh
Why
A canary is the smallest useful health signal: something you (or a monitor) hit to confirm a deploy went out and is healthy. This one goes slightly beyond a static string so it's actually trustworthy — it reports the build timestamp baked into the image (not just "up"), and it keeps a log of every boot so a rollout is visible.
Using it
- The page —
GET /— human-readable status:canary ok, build timestamp,
version, started-at, live uptime, and a recent-boots table. Works without JavaScript; JS only adds the ticking uptime and local-time formatting.
- The health endpoint —
GET /api/canary— machine-readable JSON for a
monitor to poll:
``json
{
"status": "ok",
"app": "canary-a2c9",
"version": "1.0.0",
"buildTime": "2026-07-02T19:02:11.000Z",
"startedAt": "2026-07-02T19:05:44.000Z",
"uptimeSeconds": 224
}
``
A 200 with "status":"ok" means healthy; buildTime tells you which build
is live. This endpoint is DB-free on purpose, so the signal never depends on
Postgres being up.
GET /version— the bare version string.GET /openapi— the full
API contract (auto-generated from the route schemas).
Data model
One table, appended to on every process start:
canary_boots(id, version, build_time, booted_at, host)
The page reads the most recent rows to render the deployment history. If Postgres
is unreachable the page still renders canary ok — it just notes that history is
unavailable. There's no schema-migration step to run: the table is created
idempotently on boot.
Build timestamp
scripts/gen-build-info.mjs writes src/build-info.ts with the current UTC time
as a prebuild/pretypecheck hook and again inside the Docker image build, so
buildTime reflects when the running image was actually compiled.
Running locally
npm install
npm run build # regenerates the build timestamp, then compiles
npm start # needs Postgres env (DATABASE_URL or the CNPG pg vars)
Point DATABASE_URL at any Postgres to enable the boot log; without it the app
runs fine and simply disables history. Lint / typecheck / build:
npm run lint && npm run typecheck && npm run build
Built on the platform app template: Fastify 5 + TypeScript (Node 22), TypeBox route schemas that auto-generate the OpenAPI doc, and a platform-provisioned Postgres.