My gethealth()
function contains chained promises. In version route, I want to return the object but I am currently getting pending promises in return. I am not sure how to resolve each Promise in my systemHealth
object
export const version = (req, res) => {
const systemHealth = gethealth()
res.status(200).send(systemHealth)
}
result:
console.log(systemHealth)
[ Promise { <pending> },
Promise { <pending> },
Promise { <pending> },
Promise { <pending> } ]