feat: app health endpoint succeeds (E00-S02-T03)

This commit is contained in:
implementer
2026-08-29 00:21:34 +00:00
parent 9937268d64
commit 9c049ce6b5
7 changed files with 112 additions and 26 deletions
+10 -9
View File
@@ -15,7 +15,7 @@ The workspace is a pnpm monorepo with three package groups:
| Group | Path | Purpose |
| --- | --- | --- |
| `apps/` | `apps/server` (`@personal-blog/server`) | Public server application. Bootstrap placeholder — the Fastify 5 application shell lands in a later story. |
| `apps/` | `apps/server` (`@personal-blog/server`) | Public server application. Serves the application health endpoint (E00-S02-T03); the Fastify 5 application shell lands in a later story. |
| `packages/` | `packages/core` (`@personal-blog/core`) | Application core (site identity, content primitives). Bootstrap placeholder. |
| `extensions/` | `extensions/example` (`@personal-blog/example-extension`) | Example extension exercising the `extensions/` group. Bootstrap placeholder. |
@@ -86,15 +86,16 @@ pnpm --filter @personal-blog/server start
```
This runs the `start` script of `apps/server` (`node dist/index.js`), i.e. the
compiled application entrypoint. Two things to know at bootstrap:
compiled application entrypoint. Two things to know:
1. The command **must follow `pnpm build`** — the `start` script executes the
compiled artifact in `dist/`, it does not compile first.
2. `apps/server` is currently a **bootstrap placeholder**: its entrypoint is an
empty module, so starting it loads the module and exits cleanly (exit 0)
without opening an HTTP port yet. The real Fastify 5 application shell —
which turns this into a serving process — lands in a later story; the
`start` command shape above stays the same once it does.
2. Since [E00-S02-T03], `apps/server` serves the **application health
endpoint**: starting it opens an HTTP server on port 3000 answering
`GET /health` with HTTP 200 and `{"status":"ok"}`, so the process stays up.
The real Fastify 5 application shell — which turns this into the full
serving API — lands in a later story; the `start` command shape stays the
same once it does.
To run the compiled output of any other workspace package directly:
@@ -121,7 +122,7 @@ pnpm install --frozen-lockfile # exit 0, lockfile untouched
pnpm build # 3/3 packages emit dist/, exit 0
pnpm typecheck # 3/3 packages pass --noEmit, exit 0
pnpm test # 10/10 pass, exit 0
pnpm --filter @personal-blog/server start # loads compiled server entrypoint, exit 0
pnpm --filter @personal-blog/server start # serves GET /health on port 3000, stays up
```
## Troubleshooting
@@ -131,7 +132,7 @@ pnpm --filter @personal-blog/server start # loads compiled server entrypoint,
| `pnpm: command not found` | Corepack shims not activated — run `corepack enable`, or prefix commands with `corepack pnpm ...`. |
| `ERR_PNPM_OUTDATED_LOCKFILE` | `pnpm-lock.yaml` is out of date with the manifests. Run `pnpm install` (unfrozen) and commit the lockfile update. |
| `ERR_PNPM_UNSUPPORTED_ENGINE` on install | Your Node version is outside the supported 24.x engine line (`engines.node` in the root `package.json`, enforced by `engineStrict: true` in `pnpm-workspace.yaml`). Install Node 24.x (e.g. via `nvm`, `fnm` or another version manager). |
| `start` exits immediately with no output | Expected at bootstrap — the server entrypoint is a placeholder module; the Fastify 5 shell is a later story (see [Run](#run)). |
| `start` exits immediately with no output | The server crashed or exited at startup — check the process output. Since [E00-S02-T03] the entrypoint serves `GET /health` on port 3000 and stays up; a missing `pnpm build` (stale/absent `dist/`) is the usual cause (see [Run](#run)). |
| `.env` files | `.env`/`.env.*` are git-ignored; a committed `.env.example` template lands with the environment story (E00-S04). |
## Out of scope