mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-26 10:43:35 +02:00
react-express-mysql: split backend code
Signed-off-by: Jérémie Drouet <jeremie.drouet@gmail.com>
This commit is contained in:
parent
2ef179e53b
commit
75aa52524c
7 changed files with 130 additions and 126 deletions
18
react-express-mysql/backend/healthcheck.js
vendored
18
react-express-mysql/backend/healthcheck.js
vendored
|
@ -1,20 +1,20 @@
|
|||
var http = require("http");
|
||||
const http = require("http");
|
||||
|
||||
var options = {
|
||||
const options = {
|
||||
timeout: 2000,
|
||||
host: 'localhost',
|
||||
host: "localhost",
|
||||
port: process.env.PORT || 8080,
|
||||
path: '/healthz' // must be the same as HEALTHCHECK in Dockerfile
|
||||
path: "/healthz" // must be the same as HEALTHCHECK in Dockerfile
|
||||
};
|
||||
|
||||
var request = http.request(options, (res) => {
|
||||
console.info('STATUS: ' + res.statusCode);
|
||||
process.exitCode = (res.statusCode === 200) ? 0 : 1;
|
||||
const request = http.request(options, res => {
|
||||
console.info("STATUS: " + res.statusCode);
|
||||
process.exitCode = res.statusCode === 200 ? 0 : 1;
|
||||
process.exit();
|
||||
});
|
||||
|
||||
request.on('error', function(err) {
|
||||
console.error('ERROR', err);
|
||||
request.on("error", function(err) {
|
||||
console.error("ERROR", err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue