Skip to content

Commit 974a7d5

Browse files
committed
baseURL options
Signed-off-by: Matthew Clarke <[email protected]>
1 parent 089f39b commit 974a7d5

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

lib/http.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ export default class HttpBase {
5757
this.options = this.setDefaults(options);
5858
this.rootHttp = axios.create({
5959
...options.requestConfig,
60-
baseURL: `${options.host}/api/v1`,
60+
baseURL: options.baseUrl ?? `${options.host}/api/v1`,
6161
});
6262
this.http = axios.create({
6363
...options.requestConfig,
64-
baseURL: `${options.host}/api/v1/namespaces/${this.options.namespace}`,
64+
baseURL:
65+
options.namespaceBaseURL ?? `${options.host}/api/v1/namespaces/${this.options.namespace}`,
6566
});
6667
}
6768

lib/interfaces.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export interface FireFlyOptionsInput {
4242
namespace?: string;
4343
username?: string;
4444
password?: string;
45+
baseUrl?: string;
46+
namespaceBaseURL?: string;
4547
websocket?: {
4648
host?: string;
4749
reconnectDelay?: number;

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hyperledger/firefly-sdk",
3-
"version": "1.2.10",
3+
"version": "1.2.11",
44
"description": "Client SDK for Hyperledger FireFly",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -45,4 +45,4 @@
4545
"form-data": "^4.0.0",
4646
"ws": "^8.5.0"
4747
}
48-
}
48+
}

0 commit comments

Comments
 (0)