-
Notifications
You must be signed in to change notification settings - Fork 0
Running idrop.link on Heroku
Note: The following guide assumes you have an Heroku account and you are logged in (heroku login
).
Open up a terminal. Change the directory to wherever you have downloaded/checked out idrop.link. Run heroku create
to initialise the project with heroku. Then push the code via git push heroku master
to heroku.
If you'd open the app right now, you'd get an Application Error. We need to configure the database connection. The app uses environment variables to control the database access. So if you like, you can register a free MongoDB instance on mongolab or such. Please note that the database has to be called idroplink or otherwise the app won't find the database. You then get something like mongodb://<dbuser>:<dbpassword>@<somestring>.mongolab.com:39088/idroplink
from the database provider.
Run heroku ps:scale web=1
to create a dyno and let the app run.
Note that the port
variable in the configuration file is omitted if deployed to heroku. Heroku itself sets an environment variable that replaces the configuration file port variable.
To debug the problems you might experience, type heroku logs --tail
and go through the listed problems below. Please note: Github Issues are not meant to help you with your problems.
If the log shows something like this:
2015-05-14T13:32:12.788825+00:00 app[web.1]: Listening at localhost:7667
2015-05-14T13:32:13.141562+00:00 app[web.1]: message: 'auth failed',
2015-05-14T13:32:13.141556+00:00 app[web.1]: { [MongoError: auth failed]
2015-05-14T13:32:13.141560+00:00 app[web.1]: name: 'MongoError',
2015-05-14T13:32:13.141565+00:00 app[web.1]: errmsg: 'auth failed',
2015-05-14T13:32:13.141567+00:00 app[web.1]: code: 18 }
2015-05-14T13:32:13.141564+00:00 app[web.1]: ok: 0,
2015-05-14T13:33:10.277923+00:00 heroku[web.1]: Stopping process with SIGKILL
2015-05-14T13:33:10.277810+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2015-05-14T13:33:11.501209+00:00 heroku[web.1]: Process exited with status 137
2015-05-14T13:33:11.521050+00:00 heroku[web.1]: State changed from starting to crashed
your MONGODB_URI
configured above is wrong (or the username/password), and the app can't authenticate itself to the MongoDB server.