I've tried everything there is to try. I've tried proxy, I've tried allowing CORS on my API. I think I've reached the extent of my Google searches. Is there really no way that I can test my app with a localhost API? I tried this, in my ionic.config.json I added this:
"proxies": [
{
"path": "/api",
"proxyUrl": "http://localhost:8080"
}
Then in my post request, I did this:
this.http.post('http://localhost:8100/api/users', payload).map(res => res.json())
.subscribe(res => {
console.log("The result is");
console.log(res);
}, error =>{
console.log(error);
});
The url of the API is http://localhost:8080/users
I've tried this in a lot of ways and I have been unsuccessful. I am using ionic serve
to run my app. Please, anyone that can help me out with this. I am really desperate at this point.