I am working on a backend express application and connecting the front end (react to this express backend)- I would like to have a proxy on the front end so that I can just make requests to the backend end points like thisfetch('/api/users').then(response => response.json()however, the proxy is set to set up correctly and poiting to port 5000 like this"proxy":"https://localhost:5000" # client package.json fileMy question is when I am now making requests on my front end to endpoints "/api/users" (which are stored in the backend ) I get a status of 500 Internal Server error. But when I change this request end point from "/api/users/ tofetch('https://localhost:5000/api/users').then(response => response.json()I am able to get the users from the backend. Any ideas why this is failing ?From my understanding my proxy is set up well and fine.Thank you.
Submitted November 23, 2019 at 11:57AM by FemiJodz
No comments:
Post a Comment