I have a problem when trying to communicate with my node.js server from ajax requests.
I have configured my server like this :
var allowCrossDomain = function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
};
app.use(allowCrossDomain);
When doing my requests I have this error :
XMLHttpRequest cannot load http://10.192.122.180:8181/meters. No 'Access-Control-Allow- Origin' header is present on the requested resource. Origin 'http://localhost:6161' is therefore not allowed access.
Could someone help me please ?
Thanks!