mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 15:49:10 +00:00
30 lines
773 B
TypeScript
30 lines
773 B
TypeScript
import Express, {
|
|
ExpressRequest,
|
|
ExpressResponse,
|
|
ExpressRouter,
|
|
} from '../Utils/Express';
|
|
import LocalCache from '../Infrastructure/LocalCache';
|
|
|
|
const router: ExpressRouter = Express.getRouter();
|
|
|
|
router.get('/app-name', (_req: ExpressRequest, res: ExpressResponse) => {
|
|
res.send({ app: LocalCache.getString('app', 'name') });
|
|
});
|
|
|
|
// General status
|
|
router.get('/status', (_req: ExpressRequest, res: ExpressResponse) => {
|
|
res.send({ status: 'ok' });
|
|
});
|
|
|
|
//Healthy probe
|
|
router.get('/status/healthy', (_req: ExpressRequest, res: ExpressResponse) => {
|
|
res.send({ status: 'healthy' });
|
|
});
|
|
|
|
//Liveness probe
|
|
router.get('/status/live', (_req: ExpressRequest, res: ExpressResponse) => {
|
|
res.send({ status: 'live' });
|
|
});
|
|
|
|
export default router;
|