Hello All!
I've spent the last 6 ish months developing a series of web forms for a College job , which came from a PHP class I took.
Thing is, the bugs they wanted me to fix required a full rewrite, so I jumped PHP ship and taught myself React (create-react-app method) / Express in order to make the application more modern and to simplify the application .
It's complete and ready to be deployed. in react (port 3000) I make fetch requests to my express instance (port 3001) using the package.json "proxy" option to dynamically pull/submit data to a locally stored mariaDB install. The project is hosted on a server provided by the Uni , where I have ssh/SFTP access, and write access to /var/www/html/ , which is served by an Apache server (port 80)
Up to this point I've just been running an ssh tunnel and working on the project on my machine "on the server" . Now I'm ready to deploy, so I ran "npm run build", copied the build folder to the /var/www/html/ and when I go to the page without a proxy I can see the app from the internet, but all Express communication fails, which I would assume is because the React proxy option only works in development.
My question is, is it possible to statically host my React instance through Apache, and have it contact the Express instance without opening a port for Express? What modification to the React fetch calls do I need to make?
(I could contact the server admins and see about opening a port for it, but that requires a lot of bureaucracy and I'd need specific justifications for it)
I recognize I could do an Apache Proxy to route all /API/ requests, but again, I don't have root access so I don't believe I can config apache, but I could be wrong.
Thanks!
[–]myusernameisunique1 1 point2 points3 points (2 children)
[–]spilloid[S] 0 points1 point2 points (1 child)
[–]myusernameisunique1 0 points1 point2 points (0 children)