Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49086

Ionic CORS inconsistency between android build and development environment

$
0
0

Hello guys!

I m pretty new to ionic and I m currently trying to make an app where you can get the link to the audio of the youtube video, it looks good on paper until i tried it out. I know there is a problem regarding with CORS so i tried to use cor-anywhere heroku (a cor proxy). e.g->http://cor-anywhere.heroku.com/link to get the data. It works fine but the only problem is sometimes it takes as much as 2 minutes to get what i want which is not ideal. So I made a nodejs web application and put it on my web hosting. (I also set the response header of the application to “Access-Control-Allow-Origin” to *) and then, it works well! Yay! But here comes the actual problerm.

The android build can’t seem to access my nodejs application despite it worked well in the localhost:8100 (development env), Umm to be more clear, e.g -> this is my link -> www.example.com/dosmth

let res = Http.request({
method: ‘GET’,
url: 'http://www.example.com/dosmth/?id=’+this.YoutubeID,

        });

And it didnt work.

So again, I changed it to http://cors-anywhere.heroku.com/‘mylink’ and it works well. So what is wrong with my code? Please do answer. If the information is not enough please do tell me

Regards

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 49086

Trending Articles