Add healthcheck endpoints and scripts

This commit is contained in:
sid palas
2023-02-05 10:16:47 -05:00
parent af4bca05d0
commit 1ea6754c7f
14 changed files with 241 additions and 20 deletions

View File

@ -0,0 +1,21 @@
var http = require('http');
var options = {
timeout: 2000,
host: 'localhost',
port: process.env.PORT || 3000,
path: '/ping',
};
var request = http.request(options, (res) => {
console.info('STATUS: ' + res.statusCode);
process.exitCode = res.statusCode === 200 ? 0 : 1;
process.exit();
});
request.on('error', function (err) {
console.error('ERROR', err);
process.exit(1);
});
request.end();