backend-defaults: fixed routing of health endpoints

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-07-16 21:28:51 +02:00
parent 1bd9001a7b
commit 8e967da7a0
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-defaults': patch
---
Fixed the routing of the new health check service, the health endpoints should now properly be available at `/.backstage/health/v1/readiness` and `/.backstage/health/v1/liveness`.
@@ -23,7 +23,7 @@ export function createHealthRouter(options: { health: RootHealthService }) {
const router = Router();
router.get(
'.backstage/health/v1/readiness',
'/.backstage/health/v1/readiness',
async (_request: Request, response: Response) => {
const { status, payload } = await options.health.getReadiness();
response.status(status).json(payload);
@@ -31,7 +31,7 @@ export function createHealthRouter(options: { health: RootHealthService }) {
);
router.get(
'.backstage/health/v1/liveness',
'/.backstage/health/v1/liveness',
async (_request: Request, response: Response) => {
const { status, payload } = await options.health.getLiveness();
response.status(status).json(payload);