I’m deploying an Angular app with a Hapi server remote MySQL Database on the backend and statically hosted Angular build files to render the frontend. When run locally, all http routes are sent to localhost/api/endpoint and return data via a proxy as expected. But when I deploy the app publically, although my deployment is successful and the server appears to listening on the correct port & connected to the database, the live app’s URL’s load only once and render the frontend but with 404 errors on the console for the HTTP request, and then disappear completely on refresh.
The route requests in the browser dev tools appear to be hitting the right domain (i.e. https://appurl/api/endpoint) but the requests never seem to reach the backend at all. I’m reading elsewhere on here that proxy files are not meant to be used in production and I do have separate environment files configured for development and production but seem to be missing something to process the requests in prod.
GitHub repository is publically visible here:
https://github.com/YE-SPEN/bbhl-web-app/tree/main
App URL:
https://dolphin-app-f5yuy.ondigitalocean.app/
Tried various port changes and added plenty of console logs during the build process & to the /home route but only receive a 404 not found error with no additional clues or details.
espen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.