Posted in Uncategorized

Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header

Today’s error is the following:
localhost:8100/#/app/login:1 XMLHttpRequest cannot load http://mysite.local/api/login. Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8100’ is therefore not allowed access.

I was working on ionic & everything was working fine. Then I tried to use a login API. Suddenly from nowhere, it threw up the error . I guessed, it’s from the server side. But, again it works fine from the apk . Hmm, strange!
Then I installed a chrome-app Allow-control-allow-origin . And then, they he coded happily thereafter. Happy ending for the day!

Advertisements

Author:

I am a passionate software developer currently located in Bengaluru. I love creating beautiful stuffs, reading and soccer. When I am not in front of the PC, you'll find me EITHER day dreaming ;-) OR playing soccer OR reading . FCB and NEUFC are my favorite clubs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s