Proxy Problems with Ionic

This is not working.
“proxies”: [{
“path”: “/api”,
“proxyUrl”: “https://maintenancemobiletest.nauss.edu.sa/
}]
error is: Response with status: 0 for URL: null (Ionic DevApp)

same problem as @kuwarji , problem is showing up on android.

It worked for me thanks. did not work without the trailing slashes and I cleared the browser cache.

you are missing a trailing slash, try with “/api/”

The proxy works for me when I run ionic serve but when I try to run the app on my device using ionic view. I don’t get any data back from the API. And im not sure how to debug but im certain its a cors issue. How do I get past this…please help.

Did you find any solution to your problem with the view app not returning any data for your ionic app?
We have the same issue with our app, it works with ionic serve in chrome and ionic developer app. But when we try it with ionic view it dont get any data…

I was stuck on this for over a week and this helped me resolve it. Thanks very much!

Thx work Serve restart!

Use your localhost like this: http://localhost:8100/api
It’s working for me.

In ionic 4 it seems it’s possible to use your proxy.conf.json by specifying it in your angular.json like so:

“serve”: {
“builder”: “@angular-devkit/build-angular:dev-server”,
“options”: {
“browserTarget”: “app:build”,
“proxyConfig”: “proxy.conf.json”
},
“configurations”: {
“production”: {
“browserTarget”: “app:build:production”
}
}
},

Only thing that worked for me in ionic 4