Error H12 Deploying Express JS App to Heroku

I have an app I've written in Node JS, taken about as far as I can with localhost only and need to deploy it on Heroku.

The main server.js file can be viewed here: http://pastebin.com/6VGk8ESz To understand how we hook up routing view this Lib file: http://pastebin.com/uirpUFkq

The problem is the app works fine locally but when I upload it to Heroku I always get the following responses:

at=error code=H12 desc="Request timeout" method=GET path=/ host=careboxnode.herokuapp.com fwd="64.129.24.13" dyno=web.1 connect=8ms service=30002ms status=503 bytes=0

I put console.log() statements in my code and it appears to be running without error. The problem is that both res.render and res.send do not appear to, for some reason, send anything back to Heroku to serve and thus the page times out. I get no formal errors or exceptions, all the files are being read fine. Displaying content just seems to not work.

It's quite an odd problem, so I'd greatly appreciate any help on the subject anyone has, thanks a bunch! :)

I can see what look like two bugs. One issue is very likely your use of localhost and a static port for accessing the database. On Heroku, you'll get the database URL via an environment variable.

More important, you need to get the web port from Heroku as well, as shown here: https://devcenter.heroku.com/articles/nodejs#write-your-app