MEAN Stack Front To Back [Part 10] - App Deployment to Heroku

Traversy Media · 86K views · 2017 · 16:21

Open on YouTube

Web developmentCloud, DevOps & reliabilitytutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about getting a MEAN or Angular plus Node app running on Heroku after it works locally.

Recommended by 2 people across 2 different months, 2017 to 2021.

What it is

Part 10 of Traversy Media's MEAN Stack Front To Back series, where Brad Traversy deploys the finished Angular, Express and MongoDB app to Heroku and sets up an mLab-hosted MongoDB database. It is a screen-recorded walkthrough of the deployment steps.

What people said

Recommends m_rd_n · 2017-07 · Stack Overflow · on “Heroku Node.js App Works Locally but not when deployed”

Try to recompile ( ng build -prod ) Angular side and deploy it again. Also watch MEAN Stack Front To Back [Part 10] - App Deployment to Heroku [this video]

Recommends Vimukthi Bandara · 2021-01 · Stack Overflow · on “How To Deploy Project On Heroku”

Here [LINK] you have all the information you need to configure heroku cli Here [this video] you'll find some info on deploying fontend and backend to heruku.

Cites Santironhacker · 2020-06 · Stack Overflow · on “Error trying to render the index.html that ng build generates with node and express”

If your are building a MEAN stack, you probably have a server.js or index.js or app.js as an entry point to your application. An SPA by definition manages all the routes within the router configuration. But if you try to refresh or type a route yourself, it is like you were trying to access that folder on the server (ex: [LINK] , here the folder about might not exist on the server, it is just known by your Angular app) My suggestion is that you try to add this fix to the app.js (or server.js or app.js) file, so all unexisting routes or refresh go back to your index.html: // Check your port is correctly set: const port = process.env.PORT || 8080; // Is saying express to put everything on the