Open tadwhitaker opened 8 years ago
I think you rather want to proxy that API call through express @tadwhitaker . It is Yelp not having the necessary headers to you can not do much about that. But Node can be a proxy handling the request.
So:
var request = require('request');
app.get('/yelp', function (req, res) {
request('/api.yelp.com....', function (error, response) {
res.send(response.body); // Check request API, do not remember this
})
});
Can any-body advice me the way of handling server changes, with no rerun the server manualy, and working with routes on it, thanks a lot !!
I'm trying to make a call to the Yelp API, but keep getting the following error:
XMLHttpRequest cannot load https://api.yelp.com/v2/search?term=food&location=new%20york. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 400.
Any suggestions on how to work around this?