Econnrefused For Proxy Request From Localhost To Another Localhost
To begin, I'm new to angular and I'm following a tutorial video step by step. I've been stuck on this issue for nearly 2 weeks and have spent many hours looking for solutions in o
Solution 1:
If you are using Angular and PHP built in server, you have to use IP addresses on both sides. So something like: "target": "http://127.0.0.1:8000"
on Angular side + something like php -S 127.0.0.1:8000 -t public
on PHP side.
Found this tip here: https://forum.freecodecamp.org/t/econnrefused-error-during-learn-angular-freecodecamp-org-video/245739
Solution 2:
I had the same problem and searched for a solution for ages...
In my case it helped to provide the IP of localhost, instead of "localhost".
So change your proxy-config to this:
{"/api":{"target":"http://127.0.0.1:1234","secure":false,"changeOrigin":true}}
And also try using "ng serve --proxy-config proxyconfig.json" instead of the npm start version. I read that sometimes the package.json config-part got ignored for some people.
Hope this helps!
Post a Comment for "Econnrefused For Proxy Request From Localhost To Another Localhost"