DEV Community

Hosting a Nodejs and MongoDB App on Heroku

NJOKU SAMSON EBERE on October 18, 2020

This tutorial is meant to make it easy for anyone who is hosting a nodejs application that uses the mongoDB database. If you have already checked o...
Collapse
 
mirandaftiago profile image
Tiago Miranda

Hi Samson,

I'm getting some issue with the backend and the configuration of Heroku, which I can't figure out what's going on.

On the localhost testing, everything works fine.
Any clue?

Image description

Collapse
 
ebereplenty profile image
NJOKU SAMSON EBERE

Hi Tiago,

Please check if your configurations are correct. It could be because the database isn't connected.

Collapse
 
mirandaftiago profile image
Tiago Miranda

I've followed your instructions step by step, and have check and re-check it.
Would be too much to ask one "eyes-on" from your side and maybe you spot something I haven't?

If you wish, I can send the heroku credentials to you. by email, I guess?

Thread Thread
 
kon5ky profile image
Kon5ky

By chance did you find a solution and would mind sharing? I'm stuck on the same step, somehow the database is not properly connected, but followed every step on tutorial.

Thread Thread
 
mirandaftiago profile image
Tiago Miranda

Sorry I haven't. Kinda opted out for another solution...

Collapse
 
codemight profile image
Kevin B

Hello Njoku,

Correct me if I'm wrong, but I believe the link on step one "Clone the project here" directs to the server-tutorial repo on Github when it should direct to the auth-backend repo.

The auth-backend repo is the Node.js server that has correct db setup for MongoDB

I happened to find out by browsing your repos on Github.

Correct link is: github.com/EBEREGIT/auth-backend/b...

Collapse
 
ebereplenty profile image
NJOKU SAMSON EBERE

Thank you for that observation. You are really detailed 😊

Collapse
 
aroramahima89 profile image
aroramahima89

I am still getting that application error even after creating procfile..Can someone please help me out

Collapse
 
ebereplenty profile image
NJOKU SAMSON EBERE

Please ensure that your Procfile is pointing to the right file

Collapse
 
aroramahima89 profile image
aroramahima89

Yes it is pointing to right file

Thread Thread
 
ebereplenty profile image
NJOKU SAMSON EBERE

In that case, I will suggest that you go through your application from the beginning. You may have missed a thing or 2

Collapse
 
minhhunghuynh1106 profile image
igdev

github.com/igdev116/facebook-clone...
I can't push my server to Heroku. It's always "Application Error"
Can you help me? Thanks a lot!!

Collapse
 
ebereplenty profile image
NJOKU SAMSON EBERE

Do you have procfile already created at the root directory?

The procfile is meant to direct heroku to the entry point of your application. Without it, Heroku will be confused and throw Application Error

Collapse
 
bajahranks profile image
Ravi Lamontagne

This was very helpful. Thanks

Collapse
 
ebereplenty profile image
NJOKU SAMSON EBERE

This is good news. I am happy to learn this

Collapse
 
germoedlp profile image
GermoEDLP

That Procfile file save me!!! I love you so much..... Thank you.

Collapse
 
ebereplenty profile image
NJOKU SAMSON EBERE

Wow... I am happy I could be of help. Welcome

Thank you for reading

Collapse
 
hafizjunaid971 profile image
Hafizjunaid971

Still i m facing these erro plase help me
github.com/Hafizjunaid971/fleet git repo

Some comments have been hidden by the post's author - find out more