Skip to content

CORS error for sparkl npm client in meteor 1.3 #132

@karabichoudhury

Description

@karabichoudhury

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions