Uploaded successfully to Heroku Local but getting 503 error once pushed to Heroku live

Kandianne Pierre picture Kandianne Pierre · Oct 6, 2015 · Viewed 13.7k times · Source

So after changing around files and shifting code in my MEAN stack app, I've finally got it to load on Heroku local. Now the problem is when I push this app to my Heroku remote and ask to Heroku open, the app has this error....

Failed to load resource: the server responded with a status of 503 (Service Unavailable)

Below is the link to the app on Heroku...Can any help or hint me in the right direction?

https://istressless.herokuapp.com/

Answer

jr0cket picture jr0cket · Oct 6, 2015

Once you have created a new heroku app with heroku create then ensure you have added a database and configured your Mean app with the settings defined on mean.io

To add a MongoDB database to your Heroku app with:

heroku addons:create mongolab:sandbox

Add the Mongodb string to the production env in server/config/env/production.js. You can find this string using the command heroku config

Configure your Mean app on heroku by setting some environment variables

heroku config:add BUILDPACK_URL=https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt.git

heroku config:add NODE_ENV=production

Adding a new configuration variable should redeploy your app and hopefully start your Mean application on Heroku.

All this assumes you have the Heroku toolbelt installed and your local code is under git version control.

This information is from the Heroku section of the learn.mean.io website