ionic-team / ionic-app-scripts

App Build Scripts for Ionic Projects
http://ionicframework.com/
MIT License
608 stars 304 forks source link

Proxy issue #1206

Open ThorvaldAagaard opened 7 years ago

ThorvaldAagaard commented 7 years ago

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/ http://ionicworldwide.herokuapp.com/

Short description of the problem:

I am using i proxy, i have added in ionic.config.json

When using

ioinic serve

the proxy is used, but when using

ioinc cordova run android (or Ios or browser)

the proxys is not used and the app fails

What behavior are you expecting?

I would expect the proxy definitions to work on all platforms

Steps to reproduce:

add this i the config-file

  "proxies": [
    {
      "path": "*/wheelchairs",
      "proxyUrl": "https://wheelmap.org/api/nodes"
    }
  ]

and then make a call like this

return this.http.get("/wheelchairs?api_key=XXX");

Which @ionic/app-scripts version are you using? cli packages:

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 7.0.1

local packages:

@ionic/app-scripts : 2.0.2
Cordova Platforms  : android 6.2.3 browser 4.1.0 ios 4.4.0
Ionic Framework    : ionic-angular 3.5.3

System:

Android SDK Tools : 26.0.2
Node              : v6.11.1
npm               : 5.4.0
OS                : Windows 10

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

ThorvaldAagaard commented 7 years ago

Or am I just missing the point so I have to add this kinde of code

       var host = "https://wheelmap.org/api/nodes";
        if (!this.platform.is("corodva")) {
            host = "wheelchairs";
        }
        var url = host + "?api_key=XXX";