As angular 2 cli to configure the proxy on the backend server?

after ng the serve starts the server on localhost:4000, it is necessary that when you call on localhost:4000/api or another port request went to my local openserver domain for example How to configure proxying tell me?
July 2nd 19 at 17:47
1 answer
July 2nd 19 at 17:49
Create a file called proxy.conf.json
 "/api": {
 "target": "http://localhost:3000",
 "secure": false

In package.specify json in the block scripts:
"start": "ng serve --proxy-config proxy.conf.json",

Now, instead of ng serve to run the command
npm start
how did all like you wrote but when going to localhost:4200/api Apache always throws the error: Object not foud. Error 404. - vladimir.Wucke commented on July 2nd 19 at 17:52
port the other is necessary to specify one port webpack and procs will not work. - nikita.Stracke commented on July 2nd 19 at 17:55
: I have a text backend.EN:80
and still gives the same error - vladimir.Wucke commented on July 2nd 19 at 17:58

Find more questions by tags AngularProxyWebpack