mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 14:49:07 +00:00
Refactor status API to return JSON object with status 'ok'
This commit is contained in:
parent
bf8d4757b1
commit
f601e93101
@ -26,7 +26,9 @@ export default class StatusAPI {
|
||||
|
||||
// General status
|
||||
router.get('/status', (req: ExpressRequest, res: ExpressResponse) => {
|
||||
Response.sendEmptyResponse(req, res);
|
||||
Response.sendJsonObjectResponse(req, res, {
|
||||
status: 'ok',
|
||||
});
|
||||
});
|
||||
|
||||
//Healthy probe
|
||||
@ -36,7 +38,9 @@ export default class StatusAPI {
|
||||
try {
|
||||
logger.info('Ready check');
|
||||
await options.readyCheck();
|
||||
Response.sendEmptyResponse(req, res);
|
||||
Response.sendJsonObjectResponse(req, res, {
|
||||
status: 'ok',
|
||||
});
|
||||
} catch (e) {
|
||||
Response.sendErrorResponse(
|
||||
req,
|
||||
@ -54,7 +58,9 @@ export default class StatusAPI {
|
||||
try {
|
||||
logger.info('Live check');
|
||||
await options.readyCheck();
|
||||
Response.sendEmptyResponse(req, res);
|
||||
Response.sendJsonObjectResponse(req, res, {
|
||||
status: 'ok',
|
||||
});
|
||||
} catch (e) {
|
||||
Response.sendErrorResponse(
|
||||
req,
|
||||
|
Loading…
Reference in New Issue
Block a user