meteorhacks / npm

Complete NPM integration for Meteor
http://meteorhacks.com/complete-npm-integration-for-meteor.html
MIT License
509 stars 43 forks source link

CORS error for sparkl npm client in meteor 1.3 #132

Open karabichoudhury opened 8 years ago

karabichoudhury commented 8 years ago

Hi,

I am trying to use npm package sparql(https://github.com/thomasfr/node-sparql-client) in my meteor (1.3) application. But when i am executing the query , i get an error saying "XMLHttpRequest cannot load http://dbpedia.org/sparql. A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://localhost:3000' is therefore not allowed access. The credentials mode of an XMLHttpRequest is controlled by the withCredentials attribute."

`

     import SparqlClient  from 'sparql-client';// done the import
    var endpoint = 'http://dbpedia.org/sparql';
var query = "select distinct ?Concept from <http://dbpedia.org> where {[] a ?Concept} limit 100";
var client = new SparqlClient(endpoint);
console.log("Query to " + endpoint);
console.log("Query: " + query);

client.query(query)

.execute(function(error, results) {
    console.log("error",error);
    console.log("results",results,error);
});`

I am doing this in my code. Not sure where am i going wrong. Please help,

karabichoudhury commented 8 years ago

If anyone could help on this