mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 04:56:00 +00:00
SYNC: health status
This commit is contained in:
committed by
Diflow
parent
d5f8e01dd8
commit
3bb4652a49
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user