Skip to content

feat: add a health endpoint - #1

Merged
jxom merged 2 commits into
mainfrom
feat/health-endpoint
Jul 27, 2026
Merged

feat: add a health endpoint#1
jxom merged 2 commits into
mainfrom
feat/health-endpoint

Conversation

@jxom

@jxom jxom commented Jul 27, 2026

Copy link
Copy Markdown
Member

Adds /health, reporting the service name.

Logs one friction hit on the way: load() turns a missing environment variable into the string "undefined", and the typecheck passes.

@frog-fm

frog-fm Bot commented Jul 27, 2026

Copy link
Copy Markdown

1 friction recorded

Already filed:

From .agents/friction-log. Edit an entry and push to update its issue.

@jxom
jxom merged commit 0de4ab6 into main Jul 27, 2026
2 checks passed
@jxom
jxom deleted the feat/health-endpoint branch July 27, 2026 06:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21d0c7c099

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/config.ts
return {
greeting: String(process.env.GREETING),
port: Number(process.env.PORT),
serviceName: String(process.env.SERVICE_NAME),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject a missing service name before reporting healthy

When an existing deployment upgrades without defining the newly required SERVICE_NAME, String(undefined) produces the literal string "undefined" instead of failing configuration loading. The server therefore starts and /health returns HTTP 200 with {"service":"undefined","status":"ok"}, allowing monitoring or rollout checks to accept a misconfigured instance; validate the environment variable before constructing Config.

Useful? React with 👍 / 👎.

GREETING="Hello, world" PORT=3000 node src/index.ts &
sleep 2
curl -s localhost:3000/health
kill %1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Terminate the reproduction server by its captured PID

On systems where /usr/bin/env sh resolves to dash, as in the inspected environment, job control is unavailable to this noninteractive script and kill %1 exits with kill: No such process. Running the checked-in reproduction therefore returns failure and leaves node src/index.ts alive on port 3000, which can corrupt subsequent reproductions; capture $! after starting Node and pass that PID to kill instead.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant