Add health check script and improve Redis debugging

This commit is contained in:
Andreas Dueren
2025-07-15 08:33:54 -06:00
parent 34c2d30c0c
commit 12917e3dd9
4 changed files with 41 additions and 4 deletions

34
healthcheck.js Normal file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env node
const http = require('http');
// Simple health check that attempts to connect to the app
const options = {
hostname: 'localhost',
port: 3001,
path: '/',
method: 'GET',
timeout: 5000
};
const req = http.request(options, (res) => {
console.log(`Health check: ${res.statusCode}`);
if (res.statusCode === 200) {
process.exit(0);
} else {
process.exit(1);
}
});
req.on('error', (err) => {
console.error('Health check failed:', err.message);
process.exit(1);
});
req.on('timeout', () => {
console.error('Health check timeout');
req.abort();
process.exit(1);
});
req.end();