Skip to content

v0.1.3 — fix 500 on non-existent routes

Choose a tag to compare

@spranab spranab released this 16 Apr 20:59
· 16 commits to main since this release

v0.1.3 — fix 500 on non-existent routes

Bugfix. Any 404 on the server (including /api/bogus) returned a 500 with reply.sendFile is not a function. Root cause: the UI static plugin was registered with decorateReply: false but the not-found handler called reply.sendFile("index.html") — incompatible.

Fix: remove the incompatible option and rewrite the 404 handler with path-based routing:

  • /api/*, /mcp/*, /health → JSON 404
  • everything else → SPA fallback to index.html (for browser deep-links into the UI)

Caught during end-to-end testing of mcpier@0.1.2 against the public ghcr.io/spranab/mcpier:latest image. No behavior change for anyone who only called real routes; the fix matters if anything ever curls a bad URL.

No API changes. Upgrade with npm i -g mcpier or docker pull ghcr.io/spranab/mcpier:latest.