Skip to content

Commit

Permalink
fix issue with cors
Browse files Browse the repository at this point in the history
  • Loading branch information
henriettelienrebnor committed Sep 3, 2024
1 parent b992658 commit b705edc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion rdfox/boundaries.rdfox
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ importaxioms asset:axioms
import > schema:shacl ../shacl/imf-dexpi.shacl.ttl
commitproc set commit-procedure.sparql

set access-control-allow-origin *
set endpoint.access-control-allow-origin *
endpoint start
2 changes: 2 additions & 0 deletions rdfox/endpoint.params
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Enable cors
access-control-allow-origin *
21 changes: 8 additions & 13 deletions www/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ document.addEventListener("keyup", (event) => {
if (event.key === "Enter") {
console.log("enter pressed")
let query = 'SELECT ?node WHERE{?node a data:insideBoundary .}'
var result = queryTripleStore(query)
console.log(result.payload)
console.log("tried to log")
result = queryTripleStore(query)
}
});

Expand Down Expand Up @@ -94,14 +92,11 @@ function queryTripleStore(sparql) {
fetch(`http://localhost:12110/datastores/boundaries/sparql?query=${encoded}`, {
method: 'GET',
})
.then(response => {
console.log("trying to log reposnse")
console.log(response.text())})
.then(data => {
console.log("trying to log response")
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
.then(response => response.text())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
}

0 comments on commit b705edc

Please sign in to comment.