DEV Community

Discussion on: How To Deploy a Full-Stack MERN App with Heroku/Netlify

Collapse
 
salyadav profile image
Saloni Yadav

github.com/salyadav/gundoosmean-cl...

This is the reference to the client side code hosted on netlify.

github.com/salyadav/gundoosmean-se...

This is the server side code on heroku.

The reason why this will not be an issue on local, let’s say if you have your frontend backend in different port is because both are localhost and you are not actually making a cross origin request.

There Are other ways to resolve this core error, which is including your cors header in the http request that you are making.

Adding __redirects is another way.
Things to look out for-
The base_url changed to herokus server, and the redirect for the api calls.

Let me know if the reference to the github also doesn’t help... we can debug your code further.