SYNC: health status

This commit is contained in:
SPRINX0\prochazka
2025-03-17 13:55:58 +01:00
committed by Diflow
parent d5f8e01dd8
commit 3bb4652a49
5 changed files with 40 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ const { getLogger } = require('dbgate-tools');
const { getDefaultAuthProvider } = require('./auth/authProvider');
const startCloudUpgradeTimer = require('./utility/cloudUpgrade');
const { isProApp } = require('./utility/checkLicense');
const getHealthStatus = require('./utility/healthStatus');
const logger = getLogger('main');
@@ -117,6 +118,12 @@ function start() {
});
});
app.get(getExpressPath('/health'), async function (req, res) {
res.setHeader('Content-Type', 'application/json');
const health = await getHealthStatus();
res.end(JSON.stringify(health, null, 2));
});
app.use(bodyParser.json({ limit: '50mb' }));
app.use(