I have a device that is embedded and I am attempting to establish a connection with it through my app using http. In order to achieve this, I am utilizing Ionic Proxy. Within my project file, I have the following configuration:
{
"name": "MyApp",
"app_id": "",
"proxies": [
{
"path": "/api",
"proxyUrl": "http://192.168.0.100"
}
]
}
However, when my app (being run in Chrome) attempts to retrieve JSON data from the embedded server, I encountered a 500 error, despite the fact that the API returns the correct JSON when accessed via my browser.
Here is the service I am utilizing:
angular.module('starter.services', ['ngResource'])
.factory('device_status', function ($resource) {
return $resource('/api/device_status');
});
When testing the API from my browser, the URL I am visiting is:
http://192.168.0.100/device_status
and the response is:
{"mode":"STANDBY","niveau":3,"hours":1,"minutes":30,"nightmode":1}
Additionally, I have an internal server on my localhost that provides the exact same JSON, and when I test against this, it functions correctly.