hello-svc test backend
Find a file
nholtware e770451e08
All checks were successful
/ checks (push) Successful in 36s
/ deploy (push) Successful in 1m22s
feat: add GET /log-demo route showing structured logging to Kibana
2026-11-05 10:17:13 -06:00
.forgejo fix: valid ci workflow 2026-11-05 01:57:52 -06:00
migrations Initial commit 2026-11-05 01:44:23 -06:00
src feat: add GET /log-demo route showing structured logging to Kibana 2026-11-05 10:17:13 -06:00
.dockerignore Initial commit 2026-11-05 01:44:23 -06:00
.env.example Initial commit 2026-11-05 01:44:23 -06:00
.gitignore Initial commit 2026-11-05 01:44:23 -06:00
.nvmrc Initial commit 2026-11-05 01:44:23 -06:00
.prettierignore Initial commit 2026-11-05 01:44:23 -06:00
.prettierrc.json Initial commit 2026-11-05 01:44:23 -06:00
CLAUDE.md Initial commit 2026-11-05 01:44:23 -06:00
commitlint.config.js Initial commit 2026-11-05 01:44:23 -06:00
Dockerfile Initial commit 2026-11-05 01:44:23 -06:00
eslint.config.js Initial commit 2026-11-05 01:44:23 -06:00
package-lock.json Initial commit 2026-11-05 01:44:23 -06:00
package.json Initial commit 2026-11-05 01:44:23 -06:00
README.md docs: tweak readme wording 2026-11-05 02:15:57 -06:00
tsconfig.json Initial commit 2026-11-05 01:44:23 -06:00
vitest.config.ts Initial commit 2026-11-05 01:44:23 -06:00

hello-svc

Express 5 + TypeScript backend, generated from nholtware/service-template-express.

Endpoints

  • GET /healthz liveness, always 200 once listening
  • GET /readyz readiness: Postgres SELECT 1 and Redis PING for whichever of DATABASE_URL / REDIS_URL are set; 503 + JSON reason otherwise
  • GET / service name, version (git sha), pod, a service_info row, Redis hit counter

Local dev

cp .env.example .env   # then export the vars, or use your shell's env loader
npm ci && npm run dev
npm run lint && npm test

Env is validated at boot (src/lib/config.ts): PORT, SERVICE_NAME (required), LOG_LEVEL, DATABASE_URL?, REDIS_URL?. Migrations: SQL files in migrations/, applied with npm run migrate. Logs: one JSON object per line on stdout (level,time,msg,service,version, plus req.*/res.statusCode/responseTime per request).

Using this template

  1. Generate a repo from this template in Forgejo (public). hello-svc is substituted into package.json, this README, .env.example, the CI workflow, and the first migration.
  2. Set 3 Actions secrets on the new repo: REGISTRY_USER (nholtware), REGISTRY_TOKEN (registry push token), GITOPS_TOKEN (ci-bot gitops token).
  3. Add gitops entries: render templates/backend/ (see its README) into manifests/<app>/ and add apps/<app>.yaml in nholtware/gitops.
  4. Push to main. Generating a repo emits no push event, so CI only starts on your first push.