Ionic proxy api

how to implement api proxy in ionic? My console.log says

“Failed to load No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8100’ is therefore not allowed access.”

Someone said I’m gonna use proxy api.

my actual api:

my ionic.config.json

  "name": "slingers",
  "app_id": "",
  "type": "ionic-angular",
  "integrations": {
    "cordova": {}
  "proxies": [
      "path": "/api",
      "proxyUrl": ""

my home.ts

    this.http.get(this.lets + '/v1/basketball/competitions/19816/matcheslive?ak=eebd8ae256142ac3fd24bd2003d28782&fromDate=2017-11-17&toDate=2017-12-17&teamId=88261&limit=1')
    .map(res => res.json())
    .subscribe(data => {
      this.dataMatches =;
    }, err => {

in my ios device console says:

Failed to load resource: the server responded with a status of 404 (Not Found)

Best way is to fix CORS in your server. Because you have to fix it anyways to make http calls on iOS devices. That is because WebKitWebView enforces CORS.

Allow the origin http://localhost:8100
and allow the http methods

If you cannot change the server, then use Cordova http plugin.

I fixed the issue using UIWeb instead of WKWeb. and using platform

   if ('mobile')) {
      this.lets = "";
    } else {
      this.lets = "/v1";