I built a Twitter bot with Javascript after pushing to git, and deployment is in progress. The bot works, but after a while, it shows “deploy failed”, which eventually stops the bot from responding.
Updgrading the plan shouldn’t be a factor. It should work on free tier.
When you click the deployment, what do the logs show? I know you said there werent’ errors but something must be happening behind the scenes.
That is exactly what I thought, too, but there is no error.
There is something I noticed, though. In the application, I logged a message “Server started on port …” that message didn’t show up on the log, making me feel it’s breaking somewhere, but it works fine on the localhost and Heroku. @bergur
In that case the server is most likely not starting.
What port are you running on? You should use process.env.PORT (10000 is what render uses)
So in your code if you have something like
app.listen(3000, () => {
console.log('server running on port 3000)
})
change it to
const port = process.env.PORT || 3000
app.listen(port, () => {
console.log('server running on port ' + port)
})
So when the port is not defined it defaults to 3000 (or whatever port you were using) but in an environment where port is defined (like at render) it uses that.