mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
specialpages: New /health
endpoint for health checking
This endpoint is intended to conform with: https://www.ietf.org/archive/id/draft-inadarei-api-health-check-06.html
This commit is contained in:
parent
2e4c546c7f
commit
696f9c3367
3 changed files with 68 additions and 0 deletions
|
@ -11,6 +11,16 @@ const util = require('util');
|
|||
const webaccess = require('./webaccess');
|
||||
|
||||
exports.expressPreSession = async (hookName, {app}) => {
|
||||
// This endpoint is intended to conform to:
|
||||
// https://www.ietf.org/archive/id/draft-inadarei-api-health-check-06.html
|
||||
app.get('/health', (req, res) => {
|
||||
res.set('Content-Type', 'application/health+json');
|
||||
res.json({
|
||||
status: 'pass',
|
||||
releaseId: settings.getEpVersion(),
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/stats', (req, res) => {
|
||||
res.json(require('../../stats').toJSON());
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue