Skip to content

Commit dd3518e

Browse files
Paul Mulliganclaude
andcommitted
chore(template): add APP_VERSION and HEALTH_DB_TIMEOUT_MS to env templates
The new /health endpoint reads these from c.env (Workers) or process.env (Node). Adds them to: - .dev.vars.example (Workers local dev) - .env.example (Node local dev) - wrangler.toml [vars], [env.staging.vars], [env.production.vars] APP_VERSION mirrors package.json so generated projects ship with a real value out of the box; HEALTH_DB_TIMEOUT_MS defaults to 2000 ms so the DB ping fails fast under network partition. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e9947e1 commit dd3518e

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

scripts/setup-project.sh

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/cloudflare-workers/wrangler.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@ id = "<YOUR_HYPERDRIVE_ID>"
2929
[vars]
3030
ENVIRONMENT = "development"
3131
LOG_LEVEL = "debug"
32+
APP_VERSION = "0.0.1"
33+
HEALTH_DB_TIMEOUT_MS = "2000"
3234

3335
# Staging environment
3436
[env.staging]
3537
name = "nerva-api-staging"
3638
[env.staging.vars]
3739
ENVIRONMENT = "staging"
3840
LOG_LEVEL = "info"
41+
APP_VERSION = "0.0.1"
42+
HEALTH_DB_TIMEOUT_MS = "2000"
3943

4044
[[env.staging.d1_databases]]
4145
binding = "DB"
@@ -59,6 +63,8 @@ routes = [
5963
[env.production.vars]
6064
ENVIRONMENT = "production"
6165
LOG_LEVEL = "warn"
66+
APP_VERSION = "0.0.1"
67+
HEALTH_DB_TIMEOUT_MS = "2000"
6268

6369
[[env.production.d1_databases]]
6470
binding = "DB"

0 commit comments

Comments
 (0)