Reputation: 3309
i'm trying to deploy my node app on heroku.
This app works fine localy, and is properly pushed on heroku.
However, whenever I try to reach the URL, the browsers displays:
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
At first, I thought that was because I didn't pay attention the port I was listening to (I don't really understand how Heroku processes and if the port is important) so I copied the same code as they did in their Getting started...:
port = process.env.PORT || 5000;
server.listen(port, function() {
console.log("Listening on " + port);
});
my package.json is very basic :
{
"name":"Radiorev",
"version":"0.0.1",
"dependencies":{
"express":"3.3.5",
"socket.io":"0.9.16"
}
}
Help!
By the way when I type heroku log, my cmd tools displays something quite unreadable... with zero line breaks.
Upvotes: 2
Views: 2095
Reputation: 2096
The problem might be that you scaled your web dynos to 0, so there's no one to run the server. Try running:
heroku ps:scale web=1
(Reference: https://devcenter.heroku.com/articles/error-codes#h14-no-web-dynos-running)
Upvotes: 3
Reputation: 7866
Heroku does not support websockets, so try turning it off
// assuming io is the Socket.IO server object
io.configure(function () {
io.set("transports", ["xhr-polling"]);
io.set("polling duration", 10);
});
as per Using Socket.IO with Node.js on Heroku
update: H14 - is Error H14 (No web processes running)
try adding Procfile with following contents:
web: node server.js
Upvotes: 5