Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Proxy is working, but not working, for ionic serve

$
0
0

@jpmckearin wrote:

This seems like it should be straight-forward enough. I don’t control the server-side implementation so I can’t just add the headers there. Am I overlooking something completely obvious or is there a bigger problem? Is there an example project somewhere that this actually works? My understanding is that the origin/referrer request headers should be cleared?

ionic.config.json:

...
"proxies": [
    {
      "path": "/api",
      "proxyUrl": "http://api.nicehash.com/api"
    }
  ]

provider:

...
private apiUrl = '/api';

getApiVersion(): Observable<string> {
  return this.http.get(this.apiUrl)
                  .map(this.extractData)
                  .catch(this.handleError);
}
...

“Proxy added” line in ionic serve log:

Console Error (also logged when using DevApp):

Network Request:
image

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>