mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Add healthchecks and test image before push
This commit is contained in:
26
frontend/scripts/healthcheck.js
Normal file
26
frontend/scripts/healthcheck.js
Normal file
@@ -0,0 +1,26 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
/* eslint-disable no-console */
|
||||
/* eslint-disable no-undef */
|
||||
const http = require('http');
|
||||
const options = {
|
||||
host: 'localhost',
|
||||
port: 3000,
|
||||
timeout: 2000,
|
||||
path: '/'
|
||||
};
|
||||
|
||||
const healthCheck = http.request(options, (res) => {
|
||||
console.log(`HEALTHCHECK STATUS: ${res.statusCode}`);
|
||||
if (res.statusCode == 200) {
|
||||
process.exit(0);
|
||||
} else {
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
healthCheck.on('error', function (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
healthCheck.end();
|
||||
Reference in New Issue
Block a user