Skip to content

Commit 9d9d8f7

Browse files
[DURACOM-485] fix app/health issue
1 parent 2e6896b commit 9d9d8f7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

server.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,13 @@ function healthCheck(req, res) {
667667
const baseUrl = `${REST_BASE_URL}${environment.actuators.endpointPath}`;
668668
fetch(baseUrl)
669669
.then((response) => {
670-
res.status(response.status).send(response);
670+
return response.json().then((data) => {
671+
res.status(response.status).send(data);
672+
});
671673
})
672674
.catch((error) => {
673-
res.status(error.response.status).send({
674-
error: error.message
675+
res.status(error?.response?.status || 503).send({
676+
error: error.message,
675677
});
676678
});
677679
}

0 commit comments

Comments
 (0)