0

I was wondering if there was a way to get rid of this error : No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled; when making request calls to yelp api.

I've used the node-yelp library as well another set of code that results in the same error.

Is there any way to bypass this header that its asking for?

Thanks!

exAns
  • 103
  • 1
  • 2
  • 10
  • Here is the other code that I have used https://jsfiddle.net/cs1og5f9/1/ – exAns Dec 12 '16 at 20:36
  • Access-Control-Allow-Origin is enforced by the web browser. If you are making a request via Nodejs, the default HTTP/S clients don't enforce it. Also if this is for your own development, you can instruct your browser, (Chrome and Firefox) to ignore missing Access-Control- header. https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere/ – Alan Dec 12 '16 at 20:39
  • @Alan right so if I wanted to enforce it, then would I have to simply set is in a request object ? – exAns Dec 12 '16 at 20:48

0 Answers0