我正在尝试在 heroku 上部署我的节点应用程序。
这个应用程序在本地运行良好,并在 heroku 上正确推送。
但是,每当我尝试访问 URL 时,浏览器都会显示:
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details
起初,我认为那是因为我没有注意我正在监听的端口(我不太了解 Heroku 的处理方式以及端口是否重要),所以我复制了与他们在入门中所做的相同的代码... :
port = process.env.PORT || 5000;
server.listen(port, function() {
console.log("Listening on " + port);
});
我的 package.json 非常基础:
{
"name":"Radiorev",
"version":"0.0.1",
"dependencies":{
"express":"3.3.5",
"socket.io":"0.9.16"
}
}
帮助!
顺便说一句,当我输入 heroku 日志时,我的 cmd 工具显示一些非常难以理解的内容......零换行符。