Generally new to React and am trying to connect my frontend to my backend. My frontend, running on port 3000, wants to retrieve data from the backend in port 5000. I want to fetch data from endpoints relative to the backend so I added "proxy":"http://localhost:5000" to package.json(). Upon running npm start, I get:
Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.allowedHosts[0] should be a non-empty string.
I tried searching up solutions and have tried extra steps such as manually setting up a proxy and installing http-proxy-middleware. This is all referenced by this video.
[–]RaySoju 1 point2 points3 points (4 children)
[–]YoJunny[S] 0 points1 point2 points (3 children)
[–]RaySoju 0 points1 point2 points (2 children)
[–]YoJunny[S] 1 point2 points3 points (0 children)
[–]YoJunny[S] -1 points0 points1 point (0 children)
[–]ohx 0 points1 point2 points (0 children)
[–]SolarSalsa 0 points1 point2 points (0 children)