Before provide my problem , i'd like to let you know that i am new to developpind web applications and deploy only a couple of projects on Netlify .Besides English is not my native for sure.As for the subject , i developped a mern application which inspired mostly shamahoque projects from github .Our folders tree are the same exactly and i use mongo atlas. I cannot deploy it to Netlify because ive got template.js for MUI server-side rendering on main folder , instead of index.html.When i was searching for this topic , i encountered solutions with docker and nginx but i got barely knowledge about them and not know any roadmap to learn them without youtube tutorials.For conclusion , I really need your help deploying this app on shared hosts like hostinger or at least heroku or netlify. I'd be so grateful for your help.
CodePudding user response:
If you want to host your MERN stack application in your server like AWS
then you need to install Nginx
and host on Nginx
but if you are not familiar with server setup things and required easy and simple host platforms then go for Heroku or Netlify, it will host your application in just 5 min and is not required any knowledge of Nginx
or server
setup things. About docker
it's up to you, you use it in every environment but if you are not familiar with the container system then do not go for it.
CodePudding user response:
Do following:-
- Seprate the frontend and backend code into two separate github repositories.
- Deploy the Frontend to Netlify/heroku/vercel.
- Deploy the backend to Heroku(only heroku support servers)
- You can set any environment variable using Environment variables in Netlify and config vars in Heroku.