Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Commit b9a34d4

Browse files
committed
feature(Apisearch): added http/https protocol to the apisearch options
1 parent fa3e013 commit b9a34d4

File tree

8 files changed

+19
-10
lines changed

8 files changed

+19
-10
lines changed

dist/apisearch.js

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/apisearch.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/apisearch.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/apisearch.node.js

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/apisearch.node.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/apisearch.node.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Apisearch.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Apisearch {
1616
options: {
1717
endpoint,
1818
apiVersion,
19+
protocol,
1920
timeout,
2021
overrideQueries,
2122
cache: inMemoryCache
@@ -28,6 +29,7 @@ class Apisearch {
2829
this.apiKey = apiKey;
2930
this.apiVersion = apiVersion;
3031
this.endpoint = endpoint;
32+
this.protocol = protocol;
3133
this.timeout = timeout;
3234
this.overrideQueries = overrideQueries;
3335

@@ -57,7 +59,7 @@ class Apisearch {
5759
JSON.stringify(query)
5860
);
5961
let composedQuery = {
60-
url: `${this.endpoint}/${this.apiVersion}?app_id=${this.appId}&key=${this.apiKey}&query=${encodedQuery}`,
62+
url: `${this.protocol}://${this.endpoint}/${this.apiVersion}?app_id=${this.appId}&key=${this.apiKey}&query=${encodedQuery}`,
6163
options: {
6264
timeout: this.timeout
6365
}

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ module.exports = function({
1919
checkApiKey(apiKey);
2020

2121
options = {
22-
endpoint: '//api.apisear.ch',
22+
endpoint: 'api.apisear.ch',
2323
apiVersion: 'v1',
24+
protocol: 'http',
2425
timeout: 10000,
2526
overrideQueries: true,
2627
cache: true,

0 commit comments

Comments
 (0)