Skip to content

Commit e0f098e

Browse files
[DURACOM-485] fix app/health issue
(cherry picked from commit 83f6879)
1 parent 8d3e122 commit e0f098e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

server.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,12 @@ function healthCheck(req, res) {
674674
const baseUrl = `${REST_BASE_URL}${environment.actuators.endpointPath}`;
675675
fetch(baseUrl)
676676
.then((response) => {
677-
res.status(response.status).send(response);
677+
return response.json().then((data) => {
678+
res.status(response.status).send(data);
679+
});
678680
})
679681
.catch((error) => {
680-
res.status(error.response.status).send({
682+
res.status(error?.response?.status || 503).send({
681683
error: error.message,
682684
});
683685
});

0 commit comments

Comments
 (0)