Closed gfx closed 7 years ago
the hypernova
function returns the express app
object, so you could just add additional endpoints there
fwiw this is what I also do. this does tie us to an implementation detail of hypernova though, so I'm +1 for a built in healthcheck option if it's useful to more people?
I think this should be at the discretion of the user. You can currently do this by:
hypernova(hypernovaOptions, (app) => {
app.get('/health', (req, res) => res.send(Date.now()))
})
Thanks, everyone. I agree with @goatslacker, "different folks will have different requirements".
I hope README.md shows how to add health check endpoints, which seems the best way on it.
We currently check the hypernova process by pid, but sometimes hypernova does not work even if the process lives.
This PR mount
/
as a health check endpoint to check the server is working or not.What do you think of it?