I am wondering if it is possible to deploy react.js
web app that I've built to a share hosting site that does not have node.js
installed?
I use webpack
to build the application and it creates normal html, js, css
file. I uploaded the static folder that includes all those html, js(bundle.js) and css
files, but when I request the site, the server reply with 404
bundle.js not found response.
I had the same query and the only solution that I could find was that it is not possible to deploy your MERN app on shared hosting and you need a dedicated server for your applications.
Yes you sure can put react on a shared hosting provider.
Seeing as you're getting a 404 error (not found), you are probably referencing your react file/bundle incorrectly. It might not even be named bundle.js
if you're using a boilerplate to create your application.
Can you give more information? What does your index.html file look like? What does your directory structure look like? If you are able to post these files I can tell you what the issue is.
Update: The answer below should be accepted. (Although this would assume that you have the ability to make a build which you have not verified or not.)
Make a build using the build command through whatever boilerplate you used. Deploy those files on your shared hosting server. Make sure that index.html is at the root of where your server is expecting the root to be and your app should be live.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With