I need help with running my React app on my VPS with node.
I have node running with passenger.
https://site.com will return the “hello world” correctly:
“Hello World. This page is running Node.js version: v12.22.5”
If I add the react index.html file to the /public folder it will show a blank screen and when inspected has all of the correct html. I understand this to be correct from the documentation and 2 topics from the forum.
I want to run my create-react-app with express.js on node but am I looking at it wrong? Will express.js compile with the react build? Or does express.js require node to be running it? Which is my belief. I’m thinking properly placed manifest.json or something.
I can run an express.js server in the app.js file with ports 80 and 443 and do all kinds of neat things but how do I get app.js to run react? I’m not getting how to access other folders including /public from my code.
I have done multiple “react with express” tutorials that either assume your server is setup for node+react or to sign up with someone else like Heroku.
Dreamhost’s documentation to get node and passenger running seems like they don’t realize people are going to use it for react. Or they are hoping customers will pay a tech to flip a switch. Or they won’t say it just won’t work.
But honestly, if it’s just pay another host service who does node, I will do that.
Who’s got the glue for this?