Node.js app in Heroku Works on Foreman but not When Deployed?

科技动态 2018-06-24 阅读原文

I successfully have my app running on foreman start perfectly well, but as soon as I deploy it to Heroku, it throws me an error in the logs:

2012-08-20T03:22:48+00:00 heroku[web.1]: Starting process with command `node index.js`
2012-08-20T03:22:49+00:00 app[web.1]: Server has started.
2012-08-20T03:22:49+00:00 heroku[web.1]: Error R11 (Bad bind) -> Process bound to port 15134, should be 52717 (see environment variable PORT)
2012-08-20T03:22:49+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-08-20T03:22:51+00:00 heroku[web.1]: Process exited with status 137
2012-08-20T03:22:51+00:00 heroku[web.1]: State changed from starting to crashed

I have tried to change which port it binds to, but every time I do it changes the port again. Is there something else wrong in my app?

Problem courtesy of: Brad Ross

Node.js Recipes

责编内容by:Node.js Recipes阅读原文】。感谢您的支持!


nodejs’ spawn and exec using pdf2swf I hope that there is someone that can help with this problem since I don't get it myself. I compiled the newest version of pdf2swf and eve...
What is executed (explicitly and implicitly) in pa... This example confuse my understanding of how the node.js works: // 1. numbers.forEach(function(number) { queue.push(
如何让你代码更酷炫——异步改造篇 一场大雪,整个杭城银装素裹,外面太冷就待在家里写点东西吧。这次就来简单谈谈Node.js中异步编程的几种写法。 环境准备 编辑器vscode 本地node环境(8.9.x) 本文内容 在我们工作中异步变成应该是非常常见的,请求接口,定时器,读取文件等等。本篇文...
Node.js Emerging as the Universal Development Fram... Last year and at the beginning of this year, we asked you, Node.js users, to help us understand where, how and why you are using Node.js. We wanted to...
Pull data from html javascript nodejs? I'm working on making a CLI for google searches for myself, and I've been using nodejs for a little while working on a chatbot, so I'd like to get it ...