mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 12:49:43 +02:00
23 lines
445 B
JavaScript
23 lines
445 B
JavaScript
const http = require('http');
|
|
const options = {
|
|
host: 'localhost',
|
|
port: 1337,
|
|
timeout: 2000
|
|
};
|
|
|
|
const healthCheck = http.request(options, (res) => {
|
|
console.log(`HEALTHCHECK STATUS: ${res.statusCode}`);
|
|
if (res.statusCode == 200) {
|
|
process.exit(0);
|
|
}
|
|
else {
|
|
process.exit(1);
|
|
}
|
|
});
|
|
|
|
healthCheck.on('error', function (err) {
|
|
console.error('ERROR');
|
|
process.exit(1);
|
|
});
|
|
|
|
healthCheck.end();
|