mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-16 11:14:38 -05:00
20 lines
383 B
JavaScript
20 lines
383 B
JavaScript
var http = require("http");
|
|
var options = {
|
|
host: "localhost",
|
|
port: "3001",
|
|
timeout: 2000,
|
|
};
|
|
var 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();
|