I'm developing an app using an API in Eve and AngularJS.
To avoid CORS issue, I made a simple NodeJS server to serve my static files.
However, even after allowing All domains on my Python Eve API by writing 'X_DOMAINS': '*'
(I tested with Curl and it worked) I'm getting issues in my browser when I want to call the API using $http
.
This is the error I get in chrome:
XMLHttpRequest cannot load http://localhost:5000/regions. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
I even wrote this in my Node app, even though I figured it would be useless:
app.all('/*', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With, Content-Type");
res.header("Access-Control-Allow-Methods", "GET, POST","PUT");
next();
});
Nothing has worked so far, thanks in advance for the help!