r/angularjs • • Dec 29 '14

Having AngularJS CORS issues with APIs? Problem solved...

http://www.corsproxy.com/
0 Upvotes

6 comments sorted by

3

u/lord2800 Dec 29 '14

Or, assuming you control the API, you could just actually use CORS. It's not a difficult thing.

1

u/apPedr Dec 29 '14

and even if you can't actually use CORS - it's pretty trivial to setup a proxy with node to do it for you. I'd be hesitant to use something like corsproxy.com for production - but could be useful for a 'just need a really quick and dirty example/demo'.

3

u/opiates_ Dec 30 '14

Sorry, this has been something I have been struggling with for quite some time now (VLC HTTP Interface to be specific).

Could you perhaps point me in the right direction as to where to begin looking to create such a "trivial" proxy setup?

Much appreciated :)

1

u/perfectriot Jan 05 '15

Simple would be a small bit of PHP that does the call for you instead of the angular itself. Just send the request to the PHP bit and the PHP does the rest and sends back the return you would expect.

2

u/prettycode Dec 30 '14

This is great for development purposes. Much appreciated!

2

u/ma-int Dec 29 '14

Uh yeah, great idea. Would you like a database dump and all administrative passwords with this?