package.json file:
"start": "gulp serve.dev --color",
service class:
this.mapUrl = @apiproxy
return this.http.post(this.mapUrl, body, { headers: this.headers })
Proxy.config.json:
{
"/@apiproxy/*": {
"target": "http://url:8080",
"secure": false,
"logLevel": "debug",
"pathRewrite": {"^/@apiproxy" : ""}
}
}
I tried to alter my package.json file to
"start": "gulp serve.dev --proxy-config proxy.conf.json --color",
But it is not helping. If I pass the url directly to the varibale, i'm getting Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource error. I'm new to angular. please help.