Global Error Handler
`app.js` includes centralized error middleware that logs URL, method, IP, and user agent metadata before returning response payloads.
Backend Documentation
Operational behavior for failures, diagnostics, and runtime visibility.
`app.js` includes centralized error middleware that logs URL, method, IP, and user agent metadata before returning response payloads.
Non-matched routes return `Resource not found` with status code `404` via terminal middleware.
`GET /api/health` reports environment, uptime, memory usage, and Mongo connection state to support readiness checks.
`hooks/performance.js` handles controlled server shutdown to reduce dropped connections and abrupt termination behavior.