I have an embedded device that I want to connect to from my app through http. Therefore I have to use Ionic Proxy. So in my project file I have:
{
"name": "MyApp",
"app_id": "",
"proxies": [
{
"path": "/api",
"proxyUrl": "http://192.168.0.100"
}
]
}
But whenever my App (running in chrome) tries to get some JSON data from my embedded server, I get an error 500 even though it returns the correct JSON when I visit the API from my browser.
Here's the service I am using:
angular.module('starter.services', ['ngResource'])
.factory('device_status', function ($resource) {
return $resource('/api/device_status');
});
And when I try out the API from browser I am visiting this URL:
http://192.168.0.100/device_status
and getting:
{"mode":"STANDBY","niveau":3,"hours":1,"minutes":30,"nightmode":1}
Also, I have an internal server on my localhost that returns exactly the same JSON, and if I test against this, it works fine.