This is the ionic.config.json
{
"name": "projectSniper",
"integrations": {
"cordova": {}
},
"type": "ionic-angular",
"pro_id": "5d7f8490",
"typescript": "true",
"proxies": [{
"path": "/apibase",
"proxyUrl": "http://api.esmox.apprells.com/3.0/stats/custom?slice[]=year&slice[]=month&slice[]=day&filter[date_from]=2017-03-01&filter[date_to]=2018-08-01&conversionTypes[]=confirmed&conversionTypes[]=total&limit=10&api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}]
}
when compiling it shows that it has added the api;
Proxy added:/apibase =>
[app-scripts] http://api.esmox.apprells.com/3.0/stats/custom?slice[]=year&slice[]=month&slice[]=day&filter[date_from]=2017-03-01&filter[date_to]=2018-08-01&conversionTypes[]=confirmed&conversionTypes[]=total&limit=10&api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This is the api calling part: (Ionic/Typescript)
private myUrl: string = `/apibase`;
callApi() {
this.heads.append('access-control-allow-headers','content-type,accept,access-control-allow-origin, access-control-request-method,access-control-allow-headers');
this.heads.append('access-control-maximum-age','1000');
this.heads.append('content-type','application/json');
this.heads.append('accept','application/json, text/plain, */*');
this.heads.append('Origin','*://*/*');
this.heads.append('referer','*://*/*');
this.heads.append('access-control-allow-origin','*');
this.heads.append('access-control-request-method','GET, POST, OPTIONS');
this.options = {
url: this.myUrl,
method: 'GET',
headers: this.heads
};
this.http.request(this.myUrl,this.options).subscribe(data => {
var jsonRes = JSON.stringify(data);
console.log(jsonRes);
});
}
I am getting error response as {“status”:2,“error”:“Page Not Found”}", status: 404, ok: false
Can you please tell me what am I doing wrong here… Thanks a lot…