I'm getting heroku node errors while deploying the mern app - node.js

enter image description here
I'm trying to deploy my mern app to heroku but again and again its failing i've posted the error using the image url above. Looks like some kind of node error

if you using heroku the error is not because of image you should use heroku cli
heroku log tail-- comment
to show you the exact problem I think the problem is because of your keys or database
that you should add.
I had this error and the only way was adding my mongo url cluster as a key in my heroku app.

Related

MERN Stack App Deployment Issue! ||| Seems like there shouldn't be an errors

I've deployed my MERN stack app on Heroku successfully (it's alright in Heroku's logs) but when following the link where it is deployed I only see "Heroku | Welcome to your new app! Refer to the documentation if you need help deploying.". And in devtools console I see:
"https://women-wear-app.herokuapp.com/ 502 (Bad Gateway)
GET https://women-wear-app.herokuapp.com/favicon.ico 502 (Bad Gateway)"
Please help me, I'll give a link to my Github repos if needed
The problem is that I didn't fully deploy my app and it just wasn't completely deployed. :) solved! WOOHOO

Feathers.js Docker

I am currently trying to wire up Docker and Feathers.js. I have followed the tutorial showcased from their site: https://docs.feathersjs.com/cookbook/deploy/docker.html#create-an-app
I can't seem to figure out why I am not able to connect to it outside of the container. You can see below that the container is indeed running, but when I try to hit any endpoint I am getting a "There was an error connecting to http://localhost:3030/users". You can view my Dockerfile below in the image (basically a copy from the Feathers site). End goal is to set this up with React, MongoDB and FeathersJS. React/Mongo are working well, but I can't get a connection to register for feathers either internally within docker containers, or through localhost as shown below.
As mentioned in this issue a previous version of the CLI was generating applications that are binding to the wrong hostname. Make sure that you are using the latest version of #feathersjs/cli and your src/index.js is using no hostname and looks like this:
const server = app.listen(port);

Why is Heroku ejs file name case sensitive?

I deployed my nodejs app to heroku. I kept on getting
Error: Failed to lookup view "Details" in views directory "/app/views"
Heroku
The app was working fine in my local computer. I then realized that the view name was saved as lower case details rather than Details.
Why does doing
res.render("Details")
work on my local computer but does not work on Heroku?

Deploying Github-Passport-Stategy Integrated App with Now

I'm new to application deployment, I have an Express application which uses Github's Passport strategy to authenticate users and saves them to a (remote) MongoDB database, when using localhost, my application works as expected.
I'm using the Zeit Now (OSS plan) CLI tool which was installed globally with NPM.
The issue
When I deploy my application using "now" inside the root of the project-folder and then goto "https://github.com/settings/applications/app" and swap the Homepage-URL and the "auth/github/callback" [callback] URL from "http://localhost:3000/auth/github/callback" with the URL generated by Now - so it becomes "https://app-name-pxwlglhegg.now.sh/auth/github/callback" I get redirect-uri-mismatch :
https://app-name-pxwlglhegg.now.sh/auth/github/callback?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch
I've tried several times and can't figure it out.
You change the callback on GitHub, but the same setting inside your app is not changed. So they mismatch.

Following along with the Heroku docs to create a MEAN stack app and I am stuck

I am following along with this doc here:
https://devcenter.heroku.com/articles/mean-apps-restful-api
And I am stuck on the test curl that is supposed to create a new "contact" in the Mongo database.
Up until that point I have followed the directions to the letter. The only difference is that I cloned an existing Heroku app locally instead of creating one in the CLI. I don't think this is causing an error. I cloned the blank app, installed node and dependencies using npm, then created the server.js file exactly like they said and pushed everything to my app.
It seemed successful, I can see in my Heroku account that my previously blank app is now a node app, and I can visit my attached Mongo database. However, I don't see any collections in my database, and this test curl fails:
curl -H "Content-Type: application/json" -d '{"firstName":"Chris", "lastName": "Chang", "email": "support#mlab.com"}' http://your-app-name.herokuapp.com/contacts
The contact is not posted to the database like it should be. I get a really weird response, the HTML for an application error shows up in my command prompt window, like I visited the wrong page in my app. I don't get any sort of error from express.
I am completely new when it comes to anything MEAN stack and Heroku. I did some courses in code school for node and express, but that's it. Anyone have this type of error when trying to set up MEAN on Heroku? The code that server.js should include is in the article I linked.
Edit
I figures this one out. I didn't have anything in my routes.
Figured this out myself. My routes weren't set up correctly. Watch those routes!

Resources