Skip to content

Commit f5c2f2b

Browse files
committed
Use API hostname from parameter
1 parent c89b4ac commit f5c2f2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/apifetch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require('isomorphic-fetch');
66
/**
77
* Fetch search results of search suggestions from the Addsearch API
88
*/
9-
var executeApiFetch = function(sitekey, type, settings, cb, fuzzyRetry) {
9+
var executeApiFetch = function(apiHostname, sitekey, type, settings, cb, fuzzyRetry) {
1010

1111
const RESPONSE_BAD_REQUEST = 400;
1212
const RESPONSE_SERVER_ERROR = 500;
@@ -143,7 +143,7 @@ var executeApiFetch = function(sitekey, type, settings, cb, fuzzyRetry) {
143143

144144

145145
// Execute API call
146-
fetch('https://api.addsearch.com/v1/' + apiPath + '/' + sitekey + '?term=' + kw + qs)
146+
fetch('https://' + apiHostname + '/v1/' + apiPath + '/' + sitekey + '?term=' + kw + qs)
147147
.then(function(response) {
148148
return response.json();
149149
}).then(function(json) {

0 commit comments

Comments
 (0)