Browse Source

remove/comment out search code (JS files) which declare 'serverURL'.

Because the code now establishes the 'server' variable in the various HTML Djula
templates (grabbed from the database). The code which generates the old 'server'
variable and it's data has been commented out or deleted.
stable
Craig Oates 2 years ago
parent
commit
ccc4398a52
  1. 14
      static/js/full-search.js
  2. 4
      static/js/quick-search.js

14
static/js/full-search.js

@ -14,16 +14,20 @@ links the Meilisearch instance you have running to this website (link above for
more information).
*/
let server = "";
// 'server' variable defined in /templates/search.html
// -- constructed via Djula template. URL provided by data in this website's
// database. Value stored in back-end database and varies from localhost to
// prod. Which is why the database is stored in the database and passed to the
// view instead of trying to work it out in JavaScript -- the user can't change
// it here, only the developers can.
let apiKey = "";
if (location.hostname === "localhost"
|| location.hostname === "127.0.0.1"
|| location.hostname === "beta.nera.com") {
server = "http://localhost:7700";
|| location.hostname === "127.0.0.1") {
apiKey= "meilisearch-beta-key";
} else {
server = "https://www.nera.net";
apiKey = "meilisearch-production-key-nera";
}

4
static/js/quick-search.js

@ -15,16 +15,14 @@ Meilisearch instance you have running to this website (link above for more
information).
*/
let server = "";
// let server = "";
let apiKey = "";
if (location.hostname === "localhost"
|| location.hostname === "127.0.0.1"
|| location.hostname === "beta.nera.com") {
server = "http://localhost:7700";
apiKey= "meilisearch-beta-key";
} else {
server = "https://www.nera.com";
apiKey = "meilisearch-production-key-26-07-2022";
}

Loading…
Cancel
Save