-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems deploying Express to Heroku #222
Comments
with this new block: let uri;
if (process.env.NODE_ENV === 'production') {
uri = process.env.MONGODB_URI;
} else {
uri = 'mongodb://localhost/<your project name>’;
}
— in terminal, run :
— in terminal run: in terminal, run: in terminal, run: be sure to change, in your client side app, the app.host value to point to your heroku server URL
|
Updated deployment guide: Do these steps, in order, to deploy express api template to heroku.
— sign up for mlab at mlab.com / click link in verification email
— credit card information needs to be submitted on heroku - looks like as long as you don’t MASSIVELY populate your database, you’re credit card will not be charged
- make sure you have heroku tool belt installed for MAC
— go into your express-api-template to `app/middleware/mongoose.js` and replace the following line: const uri = process.env.MONGOLAB_URI || 'mongodb://localhost/<your project name>'; with const uri = process.env.MONGODB_URI || 'mongodb://localhost/<your project name>';
You should see JSON of your home page saying: {
title: <% TITLE OF APP %>,
environment: 'production'
} If you see Application Error, you may have missed a step! be sure to change, in your client side app, the app.host value to point to your heroku server URL |
Following this tutorial on deploying express to Heroku :
https://devcenter.heroku.com/articles/getting-started-with-nodejs#deploy-the-app
Also am referring to issues opened in group project.
Upon running git push heroku master, i'm getting the build succeeded message! I've connected my front end to heroku URL that was created and I'm receiving this error in my console:
Running the heroku log --tails command, I see this:
The text was updated successfully, but these errors were encountered: