I’m having trouble accessing google api’s at the moment on device (ironically). Kind of reverse to what problem many of you have. Because when you run ionic run android -l it uses the IP of the phone, 192.168.0.1.x as the base instead of localhost (as on my laptop environment)- googles api security does not accept any requests when I test on my phone.
Any suggestions?
I’m trying a way around by creating a node proxy on my server and relaying packets, though for authentication I’m still not sure how this would work. Hoping for an easier solution!
Appreciate any time and help, as I’m still Learning.
https://my-domain.com/web/session/ and https://my-domain.com/web/dataset/call_kw/ this remains common in many of the places.
The changing part is project.task/write or project.task/create or authenticate, etc.
Can you please help how can I handle this in proxy? I’m not able to make it for multiple URLs.
Your calls in your app should then go to /api/web/sessions/authenticate.
It might be helpful for someone who is new to proxys to test with node module “http-server”. Just install with npm i -g http-server. It will only create a server at any port u want. Then any request is logged to the console. So you can play around with the paths until you see that you have the correct settings. Then change to your actual url ( before you use e.g. http://localhost:8080 as proxy url).
error_handler.js:47 EXCEPTION: Response with status: 404 Not Found for URL: http://localhost:8100/forecast/myKeyShowCorrectly/43.669579,-79.38863?units=ca&exclude=alerts,flags,madis-stations,daily,minutely,hourly
Hi, same problem here. If I create proxy, it works with ionic serve, but does’nt work with ionic run, because “file:///api/sales.php Failed to load resource: net::ERR_FILE_NOT_FOUND”. Any ideas? Thanks!
The above code given by kattasrinu is perfectly fine except that the ‘proxyUrl’ should contain /api at the end. So the updated code would look like this.