wxcc-monitor/scripts/healthcheck.js
jmcqueen 935c27854b Initial commit with Docker deployment support.
Containerize the monitor with production and dev compose stacks, fix healthchecks and port handling, and make the dashboard base path configurable for direct or proxied access.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-23 08:04:02 -04:00

13 lines
303 B
JavaScript

import http from 'http';
const port = Number(process.env.PORT) || 3000;
const req = http.get(`http://127.0.0.1:${port}/health`, (res) => {
process.exit(res.statusCode === 200 ? 0 : 1);
});
req.on('error', () => process.exit(1));
req.setTimeout(4000, () => {
req.destroy();
process.exit(1);
});