I am working on a MERN app and it is working fine in localhost. Yesterday I hosted it in heroku and the API , UI are working fine.
But I am unable...
For further actions, you may consider blocking this person and/or reporting abuse
Hello, you can try referring to this video on how to deploy MERN with heroku. Hopefully it help you solve the problem you are facing
youtube.com/watch?v=71wSzpLyW9k&ab...
Sure I'lltry this and let you know
I think I did same as this video..but not working. If I add that app.get('*',(req,Res)) then I am getting mapping error.
I think you are missing the build folder inside the client folder, perhaps you can try npm run build first and then redeploy it to heroku. Because your code is referring to build folder which is inside the client folder and i did not see build folder inside your client folder directory
No the buld folder is there. I just used .gitignore and added/build when pushing to GitHub. The app is running. Only think is I am able to see the home page and the API which is in home page.. I am unable to navigate to other pages.
how about you add app.get("*") from my code
did you add this in your server ??
you can look here at the steps to do the same
github.com/accimeesterlin/mern-sta...
Hope it helps
Chill!!!
If you can , can you check whether my frontend mapping is correct? Because if I add the above code it is showing mapping error. But the code is completely working on local server.
And without the above code the home page and the mapping inside it are working fine. Only the navigation is not working.
(Actually I referred this person's YouTube video and deployed)
Yes when I add that I am getting the error as this.state.dates.map is not a function. (A mapping error)
I had the same issue. I fixed it the following way:
once you have built the react app with npm build command then you need to go to public directory and add a new file called:
_redirects
content of the file should be:
/* /index.html 200
you can check this in my repo:
github.com/ali-farhad/material-ui-...
That is aalo not working. Do I need to mention that file in somewhere?
no does not need to be mentioned anywhere. but again you have a MERN app. I had CRA app so that is why this solution might not apply to your project.
Oh may be that's the reason
Please someone help. I tried everything I can. Please give me some solutions.