Decide on SEARCH_ENDPOINT based on current URL.
This commit is contained in:
parent
f66d69776b
commit
a18c94dca0
1 changed files with 4 additions and 1 deletions
|
@ -47,7 +47,10 @@ function _codigoparallevar_enable_search_box(selector, options) {
|
|||
|
||||
const DEBOUNCE_TIME = 500; // Milliseconds
|
||||
const MIN_LENGTH = 3;
|
||||
const SEARCH_ENDPOINT = 'https://api.codigoparallevar.com/api/search';
|
||||
const SEARCH_ENDPOINT = (window.location.host.startsWith('localhost')
|
||||
? 'http://localhost:3001/api/search'
|
||||
: 'https://api.codigoparallevar.com/api/search'
|
||||
);
|
||||
|
||||
let debounceWaiter = null;
|
||||
let currentQuery = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue