diff --git a/static/js/full-search.js b/static/js/full-search.js index 94f722b..36234ad 100644 --- a/static/js/full-search.js +++ b/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"; } diff --git a/static/js/quick-search.js b/static/js/quick-search.js index 7ca3f09..26fedd9 100644 --- a/static/js/quick-search.js +++ b/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"; }