Heroku Deployment 404 Error with Node.js and Express.js Server - node.js

Anyone willing to help with a Heroku Deployment?
When I run my local repo the server works great but once I deploy it on Heroku I get a 404 Error.
I am using Node.js Express Server.
The server console is suppose to generate: Listening on port 5000!
The error I get instead is: {"error":{"message":"Error not found in app.js"}}
Git Hub Repo
https://github.com/instant-help/instant-help-backend
Deployed Repo
https://thawing-river-10076.herokuapp.com/

Related

Heroku fails to host my Node.js App , I just see "Cannot Get /"

I have looked at similar questions and not been able to solve this problem with what I found. I initially followed a YouTube tutorial on how to deploy a Node.js App to Heroku. After trying and failing, I began troubleshooting and could not fix the problem.
I then followed the instructions on Heroku's website for deploying a Node.js application here: https://devcenter.heroku.com/articles/deploying-nodejs and I found I seem to have done all the steps correctly. I was just missing the node version in the package.json which I have now added.
Here is how I have connected my Node.js app:
image of Heroku application dashboard
And here is the connected Github repo: https://github.com/AmeenIzhac/food-and-flow-backend
You can see in the repo that my port is specified correctly:
const port = process.env.PORT || 4000;
I then tried running the app locally on the command line with:
heroku local web
and this worked as you can see my application running on port 5000:
App running locally on port 5000
However when I press "Open app" in Heroku, I just see this:
Heroku hosted app fails to get /
I feel like I have done everything correctly but it doesn't seem to work. Any help to get it working would be much appreciated.
You need a procfile. What is the heroku error in heroku logs --tail?

Unable to fix NGINX 502: Bad Gateway error on a Digital Ocean droplet - Ubuntu 20.04

I have deployed my website to a Digital Ocean droplet (Ubuntu 20.04 server).
Everything was working fine. Today, I did some changes to the website in my local machine. So I pushed the changes to GitHub and then cloned the GitHub repo again to the server. Then, I installed the dependencies and restarted PM2.
Now, when I visit my site https://sundaray.io, I get the following error.
The following is the error log.
How can I fix the error?
Simple meaning is
No HTTP server response, your Node Http server is not answering requests.
502 gateway mean server and Nginx is getting your request but there is issue with upstream.
you can use the command to show the logs of pm2
pm2 show
the application might be crashing or internal server 500 error.

Why is my basic hello world nodejs app not working on Heroku?

I got this errror:
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail
I tried adding various repositories that other people have built as well.
Does Heroku require certain file requirements for the app to show up?
My git repository is located here: https://github.com/nathanpuls/helloworld2
My heroku app is located here: https://wyresapp.herokuapp.com/
If you have deployed your app to Heroku as it is in the git repository, then you are missing two things.
You should assign an environment value for the port so that Heroku can use it to set the port number. It won't run the app on a user-defined port number. It should look sth like,
var port = process.env.port || 3000;
Procfile is missing. It is a simple file that instructs what kind of app you have and how it should start. In your case, it should be
web: node index.js

after deploy mean stack project on heroku it work only when local server running if close local server

after deploy mean stack on heroku in work good if local server running but if i close local server get error "POST http://localhost:4000/api/newcontact net::ERR_CONNECTION_REFUSED " and how it work with localhost after deploying
In your code, you might be using http://localhost:4000 in the services. Change it to the URL where your API is actually hosted.

Express server unable to proxy to my React project

I have an issue, my server is giving me an error that it is unable to proxy from localhost:8080 to localhost:3000 on my local machine, it also showed a Http parse error together.
I am trying to run a React and Express project and it worked when I used cloud9 to run it.

Resources