i was struggling with this issue for several day, trying all possible suggestions, but with no luck.
facing the problem with CORS running my angular app on virtual machine using the following command:
ng serve --host=0.0.0.0 --port=4201 --disable-host-check --proxy-config
the back-end URL i'm trying to reach looks like this: http://sse.mybackend/events i've created the "proxy.conf.json":
{ "/client-api/*": {
"target": "http://sse.mybackend/events",
"pathRewrite": { "^/client-api": "" },
"secure": false,
"changeOrigin": true
}
}
i was trying the following URL in the client call:
`http://localhost:4201/client-api/events`,
but the browser responds me:
GET http://localhost:4201/client-api/events net::ERR_CONNECTION_REFUSED.
obviously not finding anything running on this URL. Looks like the config file haven't been applied.
Could you please help me to configure it correctly? Thanks in advance, Liudmila