Skip to content

Health Endpoint

sarmakska edited this page Jun 4, 2026 · 1 revision

Dashboard /api/health

Available since v0.6.1.

The dashboard server advertises its build version, process id and boot timestamp on a tiny JSON endpoint. Clients use it to decide whether a previously running dashboard is fresh enough to reuse or needs restarting.

Response shape

GET http://127.0.0.1:<port>/api/health
{
  "version": "0.6.1",
  "pid": 14231,
  "startedAt": "2026-06-04T17:00:21.812Z"
}
  • version is read from the installed package.json at module load. No filesystem reads happen at request time.
  • pid is the process id of the dashboard server.
  • startedAt is the ISO timestamp of the server boot.

Why it exists

Before v0.6.1, sp_dashboard reused whatever server happened to be holding the port. If you upgraded slipstream and the previous dashboard process was still running, you got the old UI. The new flow:

  1. Calling sp_dashboard first calls liveServer(projectRoot) to read the recorded server info.
  2. If the server is alive and listening, the launcher probes /api/health.
  3. If the running version does not match the installed package.json version, the launcher signals the old process and spawns a fresh one.
  4. If the versions match, the existing server is reused as before.

The doctor's stale-dashboard check uses the same probe to flag the condition before you call sp_dashboard.

Local-only

/api/health is bound to 127.0.0.1 like the rest of the dashboard. Nothing reaches it from another machine. There is no auth on the endpoint because the bind itself is the security boundary.

Related

Clone this wiki locally