Error retrieving data from backend server on Netlify

223 Views Asked by At

I have a Netlify project running which contains two git submodules. Module 1 is a frontend server running on React. Module 2 is an Express server that retrieves data and returns it. I am now trying to fetch a URL in order to retrieve the correct data from the backend server. But unfortunately I am getting this error: 'Unexpected token < in JSON at position 0'.

The only line in my _redirects file (located in public folder of frontend server) is now: /* /index.html 200

I have a proxy set to http://localhost:4000 (backend server) in the package.json of the frontend server.

Can someone tell me where the problem lays?

Backend Server enter image description here

Router in the backend server enter image description here

Trying to fetch data like this

This happens on the frontend server running on port 3000. enter image description here

0

There are 0 best solutions below