I am bit confused about deploying my react/node app. I have a domain that I purchased but not sure how to deploy. cPanel can host react apps but not sure about node =/
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (8)
Deploying a React/Node app is easy check out these serverless hosts. Who is your domain with? You can add your DNS records to say Netlify for example and get your domain and website working easily.
And if you want to connect the node backend to the react frontend you just need to change the server from localhost to whatever address you get when you deploy it online.
netlify.com/
vercel.com/
heroku.com/
surge.sh/
pages.github.com/
One thing to consider here is whether your app truly needs to be dynamic content, or whether you could in fact create a "static" site.
The reason I bring this up is that both GitLab (and I believe GitHub although I've not tried) will host static sites for free. If you're unsure of the difference, GitLab wrote a great article detailing it here: static vs dynamic
This way, you can also begin learning about pipelines (CI/CD) and begin the journey down boosting your productivity by automating your workflows.
I think you have to first host your node js app and then configure your react app to communicate with you hosted node js app and then host your react app using cPanel as built react app is static web page.
This really depends on how your hosting provider works, as not all are equal. Its possible a "React app" can be hosted because React can build static files (HTML, CSS, JS) and basically all hosting providers can host static files.
I'd look into your hosting providers docs and see if/how they support nodejs. Its possible they don't provide a hosting/runtime for any back-end apps (Nodejs, PHP, Python, Java, whatever) and you may need to use another provider.
One way you can do it is to host both the frontend and backend together and serve the bundle. I use this pattern in this blog post: dev.to/jamesroyston/how-to-deploy-...
You can use DigitalOcean Server. It is very easy to deploy react/node js app. I have rich experience in this part.
Thanks
If is only frontend. Github-pages, check this post:
dev.to/ranaemad/deploy-react-apps-...
Thank you all for replies. I will try do what Andrew suggested because I have used it to host just react app before. S: hope it works