This is because you are running a React SPA. The solution to this issue is outlined in the following support guide as well as in this Netlify documentation and this Create React App documentation.
With the database
I suspect you have a proxy set up (e.g. in the package.json
) which allows this to work. You have two choices on Netlify:
- call the server URL directly from within the app; or
- create a proxy to the database server to use relative paths (e.g.
/data
.)
Documentation for the latter you will find Proxy to another service.