Skip to content

Commit

Permalink
handle CORS requests
Browse files Browse the repository at this point in the history
  • Loading branch information
cbadenes committed Oct 28, 2019
1 parent bc305f1 commit d13e831
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions js/solrstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

//var SOLR_ENDPOINT = 'http://librairy.linkeddata.es/data/tbfy'; //SELECT endpoint
var SOLR_ENDPOINT = 'http://localhost:8983/solr/documents'; //SELECT endpoint

//var SOLR_EXTERNAL_ENDPOINT = 'http://librairy.linkeddata.es/data/tbfy'; //SELECT endpoint
//var SOLR_EXTERNAL_ENDPOINT = 'http://localhost:8983/solr/documents'; //SELECT endpoint
var SOLR_EXTERNAL_ENDPOINT = 'http://librairy-solr:8983/solr/documents'; //SELECT endpoint

//var LIBRAIRY_ENDPOINT = 'http://librairy.linkeddata.es/api/ranks'; //SELECT endpoint
var LIBRAIRY_ENDPOINT = 'http://localhost:8081/ranks'; //SELECT endpoint
//var LIBRAIRY_USER = 'oeg'; //SELECT endpoint
var LIBRAIRY_USER = 'demo'; //SELECT endpoint
//var LIBRAIRY_PASSWORD = 'oeg2018'; //SELECT endpoint
var LIBRAIRY_PASSWORD = '2019'; //SELECT endpoint

var HITTITLE = 'name_s'; //Name of the title field- the heading of each hit
var HITBODY = 'topics0_t'; //Name of the body field- the teaser text of each hit
var HITID = 'id' // Name of the id field
Expand Down Expand Up @@ -127,10 +128,7 @@ $(document).ready(function() {
dataType: 'json',
data: buildLibrAIryParams(q, fq, dq, offset),
xhrFields: {
withCredentials: true
},
beforeSend: function (xhr) {
xhr.setRequestHeader('Authorization', 'Basic ' + btoa(LIBRAIRY_USER +':' + LIBRAIRY_PASSWORD));
withCredentials: false
},
processData: false,
error: function (xhr, status, error){
Expand Down

0 comments on commit d13e831

Please sign in to comment.