After deploy, health endpoint apparently doesn't return a 200, but it does locally

I have the simplest Node.js API running, with a /health endpoint that only returns 200 OK.

After a deploy is ran, it keeps waiting… and then after 15 minutes, the deploy failed.

I double checked the logs, nothing.

I also double checked the health endpoint setting which is set to /health

Sometimes it works, sometimes it doesn’t.

Please help out.

This is the code:

import http from 'http'

const server = http.createServer((req, res) => {
  res.writeHead(200)
  res.end()
})

server.listen(process.env.PORT || 4000)

Hi Mike,

Thanks for reaching out.

I think this may be the same issue as the ticket you opened? If the solution is what I mentioned in the ticket, maybe posting an update of the solution here may be helpful for the community. For now, let’s keep the conversation in the ticket, and we can update this post with the solution once confirmed.

Thanks

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.