diff --git a/.gitignore b/.gitignore index 931739a7..a49a1d81 100644 --- a/.gitignore +++ b/.gitignore @@ -100,6 +100,12 @@ backup/ # Local artifacts from browser tooling .playwright-mcp/ +# Local-only E2E suite (never pushed; runs as pre-push gate on this machine) +tests/e2e/local/ +playwright-local-results/ +e2e-test.log +scripts/e2e-local.sh + # Local SQLite files in backend backend/*.sqlite* backend/*.db diff --git a/backend/server.js b/backend/server.js index 5bd6f1b4..ba62cc4a 100644 --- a/backend/server.js +++ b/backend/server.js @@ -486,21 +486,24 @@ app.get('/robots.txt', async (req, res) => { } }); -// Health check endpoint +// Health check endpoint. `pid` + `uptime` let monitors (and the local E2E +// watchdog) detect a silent process restart between two checks. app.get('/health', async (req, res) => { try { - // Check database connectivity await db.raw('SELECT 1'); - res.json({ status: 'ok', - timestamp: new Date().toISOString() + timestamp: new Date().toISOString(), + pid: process.pid, + uptime: process.uptime() }); } catch (error) { logger.error('Health check failed:', error); res.status(503).json({ status: 'error', - timestamp: new Date().toISOString() + timestamp: new Date().toISOString(), + pid: process.pid, + uptime: process.uptime() }); } });