Answer the question
In order to leave comments, you need to log in
Why proxy in ReactJS doesn't change url?
Front on: localhost:3000
Back on: localhost:3001
In package.json: "proxy": " localhost:3001 ",
Network tab: the request goes to localhost:3000/news
And you need to 3001.
Code to send the request:
fetch("/news")
.then((res) => console.log(res)) // url: " localhost:3000/news "
.then((arr) => console.log(arr))
.catch ((err) => console.log(err));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question