1
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-11-28 08:48:45 +02:00
uptime-kuma/extra/healthcheck.js
2021-08-09 13:49:37 +08:00

20 lines
409 B
JavaScript

let http = require("http");
let options = {
host: "localhost",
port: "3001",
timeout: 2000,
};
let request = http.request(options, (res) => {
console.log(`STATUS: ${res.statusCode}`);
if (res.statusCode == 200) {
process.exit(0);
} else {
process.exit(1);
}
});
request.on("error", function (err) {
console.log("ERROR");
process.exit(1);
});
request.end();