You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

25 lines
454 B

import { request } from "node:http";
const options = {
host : "localhost",
path: "/api/v1/health",
port : "3333",
timeout : 2000
};
const healthCheck = request(options, (res) => {
if (res.statusCode === 200) {
process.exit(0);
}
else {
console.error(res.statusMessage)
process.exit(1);
}
});
healthCheck.on('error', (err) => {
console.error(err);
process.exit(1);
});
healthCheck.end();