When I try to connect to my server, I have a 404 error each time, because the application is trying to connect to this url http://localhost:60001/api/ instead of http://my-url-server/api
{'statusText': 'Not Found', 'headers': {'access-control-allow-credentials': ['true'], 'access-control-allow-headers': ['origin', 'accept', 'content-type'], 'content-encoding': ['gzip'], 'access-control-max-age': ['151200'], 'connection': ['keep-alive'], 'content-type': ['text/plain'], 'date': ['Mon', ' 12 Feb 2018 13:18:04 GMT'], 'access-control-allow-methods': ['GET', ' POST', ' PUT', ' DELETE', ' OPTIONS', ' HEAD'], 'accept-ranges': ['bytes'], 'access-control-allow-origin': ['*'], 'transfer-encoding': ['chunked']}, 'status': 404, 'url': 'http://localhost:60001/api/login?some_param1=cds&&some_param2=hello', '_body': 'Error 404, file not found.', 'type': 2, 'network': {}, 'ok': False}
instead of the one defined in my configuration file (the URL of the server API). I’m using UIWebView as the main engine and my config.xml file looks like this:
<allow-navigation href="http://*/*" />
<preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
My Ionic configuration is as follows:
@ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : android 7.0.0 browser 5.0.3 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v6.12.3
npm : 5.6.0
OS : Linux 4.4
Environment Variables:
ANDROID_HOME : /opt/android-sdk
Misc:
backend : pro
I have trouble understanding where the problem may come from.
Thank you for your help