I'm using Yeoman/bower/grunt to build an angular app. The app runs perfectly on foreman. In my search of similar questions on stack most other people just forgot to create their Procfile or had mistakes in their app.js which ran the app. But I have both of those and I can't figure out what's wrong with them, such that foreman works and not heroku. When I deploy to heroku and open it I get this in the log:
2013-10-02T19:33:56.159151+00:00 heroku[api]: Deploy b417d22 by richardadavila@gmail.com
2013-10-02T19:33:56.202052+00:00 heroku[api]: Release v10 created by richardadavila@gmail.com
2013-10-02T20:38:51.350572+00:00 heroku[web.1]: Idling
2013-10-02T20:38:57.626159+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-10-02T20:39:02.097317+00:00 heroku[web.1]: State changed from up to down
2013-10-02T20:39:02.079612+00:00 heroku[web.1]: Process exited with status 143
2013-10-02T22:00:00.360769+00:00 heroku[web.1]: Unidling
2013-10-02T22:00:00.361135+00:00 heroku[web.1]: State changed from down to starting
2013-10-02T22:00:04.049439+00:00 heroku[web.1]: Starting process with command `node app.js`
2013-10-02T22:00:06.128657+00:00 app[web.1]: server started 40741
2013-10-02T22:00:06.164522+00:00 heroku[web.1]: State changed from starting to up
2013-10-02T22:00:07.479644+00:00 heroku[router]: at=info method=GET path=/ host=rickydavila-kpopbetter-s.herokuapp.com fwd="71.144.19.194" dyno=web.1 connect=9ms service=30ms status=404 bytes=22
No error (I probably don't fully understand the log), it just kills the app.
My Procfile says: "node app.js"
My app.js file that creates an express server to run the app is:
var express = require('express');
var path = require('path');
var app = express();
app.configure(function(){
'use strict';
app.use(express.bodyParser());
app.use(express.static(path.join(__dirname, 'dist')));
});
var port = process.env.PORT || 5000;
app.listen(port, function() {
'use strict';
console.log('server started '+port);
});
Grunt builds the app to my dist folder which I reference above. Any clear mistakes above? When I open the heroku app url, the page states: Cannot GET /
Oh I also have scaled the dynos as some other questions failed to do. And to my knowledge I'm not hardcoding the port.