You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run the application, I got error messages from cmd console.
[HPM] GET /api/upload/uploads-1490782788752.png -> http://localhost:3000
[HPM] Error occurred while trying to proxy request /api/upload/uploads-1490782788752.png from localhost:4300 to http://localhost:3000 (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors)
I have tried to set target in the proxy.conf.json using 127.0.0.1, dev.local(virtual hosts configured in hosts file) instead of localhost, all failed under Windows 10.
But the the internal network ip(192.168.0.110) works.
Follow the NG CLI wiki page (proxy to backend, I am trying to configure proxy to the backend API.
The backend is a nodejs/express application, served at port 3000. The frontend is NG 2 application generated by Angular CLI.
I added a proxy.conf.json in the root folder of frontend application.
and changed the
start
command in package.json. I also tried the simplest config in the Wiki page(proxy to backend, it does not work).When I run the application, I got error messages from cmd console.
The image should be accessed via http://localhost:4300/api/upload/uploads-1490782788752.png, but failed, and it is existed. When access http://localhost:3000/api/upload/uploads-1490782788752.png, it displays the image directly.
When I accessed http://localhost:4300/api/upload/uploads-1490782788752.png, in Chrome browser. It displays a message:
My local development environment:
I have tried to set target in the proxy.conf.json using 127.0.0.1, dev.local(virtual hosts configured in
hosts
file) instead of localhost, all failed under Windows 10.But the the internal network ip(192.168.0.110) works.
I think this is Windows specific bug.
BTW,1. I also used proxy on localhost in before projects, it works. eg. https://github.com/hantsy/angularjs-springmvc-sample-boot/blob/master/gulpfile.js, proxy configured via proxy-middleware.
2. I have tried to use
ng eject
to export webpack.config and set proxy in it, and got the same errors.The text was updated successfully, but these errors were encountered: