mirror of
https://github.com/docker-training/node-bulletin-board.git
synced 2025-05-18 03:49:31 +08:00
24 lines
417 B
JavaScript
24 lines
417 B
JavaScript
var http = require("http");
|
|
|
|
var options = {
|
|
host : "localhost",
|
|
port : "8080",
|
|
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(); |