Search code examples
angularjsgruntjssame-origin-policybrowser-sync

How to set up BrowserSync and/or Angular $http to work together without cors issues


I have BrowerSync setup who serves my AngularJS application. It works great till I want to call my REST-API which is MS Web-Api project running on IIS Express.

So, I have JS application running on locahost:3000 calling through $http rest-api run localhost:4000 so I do have CORS issues.

How to set up BrowserSync or any other software (on Windows 8) to get rid these issues?

The perfect way to me would be some grunt profile.


Solution

  • What I did, and what was the easiest thing to do without touching anything was running chrome without cors.

    PS C:\Program Files (x86)\Google\Chrome\Application> .\chrome.exe --user-data-dir="C:/Chrome dev session" --disable-websecurity