mirror of
https://github.com/docker-training/node-bulletin-board.git
synced 2025-12-13 14:26:44 +08:00
Add logging & config; update base images
This commit is contained in:
24
bulletin-board-app/healthcheck.js
Normal file
24
bulletin-board-app/healthcheck.js
Normal file
@@ -0,0 +1,24 @@
|
||||
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();
|
||||
Reference in New Issue
Block a user