아래 예제 코드를 사용하면 Heroku Node.js 앱이 다운됩니다. 나는 [MyApp를] .herokuapp.com로 이동 할 때 응답하지 않는Node.js Heroku 앱이 오류 R10 (부팅 시간 초과)으로 충돌합니다. 'heroku restart`이 작동하지 않습니다.
var http = require('http');
var port = process.env.PORT || 8000;
var counter = 0;
http.createServer(function (req, res) {
// increment the counter for each visitor request
counter=counter+1;
var path = req.url;
console.log("requested=" + path + " counter=" + counter);
res.writeHead(200, {'Content-Type': 'text/html'}); // prepare response headers
res.end(" :) ");
}).listen(port);
내 procfile 내가
나는 약간의 종속성을했다 heroku ps:scale web=1
을 수행하되 시도를 제거한
web: node thenameofmyapp.js
입니다 간단한 앱을 사용해보세요. 현재 package.json이
입니다.{
"name": "thenameofmyapp",
"version": "0.0.3",
"dependencies": {
},
"engines": {
"node": "0.10.x",
"npm": "1.2.x"
}
}
내 앱이 포트에 바인딩되지 않는 이유는 무엇입니까?
EDIT : 여러 번 업데이트하고 heroku restart
을 실행하는 것처럼 보이지만 내 앱이 더 이상 존재하지 않는 코드를 실행하고 있습니다. 무슨 일 이니?