this is the code in ionic to link to my slim api:
postData(credentials, type){
return new Promise((resolve, reject) =>{
let headers = new Headers();
this.http.post("http://slimapp:8080/api/signup", JSON.stringify(credentials), {headers: headers}).
subscribe(res =>{
resolve(res.json());
}, (err) =>{
reject(err);
});
});
}
credentials is my data and type is"signup"
and this is the slim php code tp match the route
$app->post(’/api/signup’, function(Request $request, Response $response){
// my function is here
});
when i connect postman with php slim, everything works well, but when i connect it with ionic, this error comes up:
[404]: /api/signup - No such file or directory
how to fix this?