We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a479430 commit 1c8e42eCopy full SHA for 1c8e42e
lib/client.js
@@ -5,11 +5,12 @@ const FormData = require('form-data');
5
6
class Client {
7
constructor(apiKey) {
8
+ this.apiURL = 'https://api.labstack.com'
9
this.apiKey = apiKey
10
}
11
12
_request(method, path, body, json) {
- return got.post(`https://api.labstack.com${path}`, {
13
+ return got.post(`${this.apiURL}${path}`, {
14
headers: {
15
'Authorization': `Bearer ${this.apiKey}`
16
},
@@ -31,7 +32,7 @@ class Client {
31
32
33
download(id, path) {
34
return new Promise((resolve, reject) => {
- got.stream(`https://api.labstack.com/download/${id}`)
35
+ got.stream(`${this.apiURL}/download/${id}`)
36
.pipe(fs.createWriteStream(path))
37
.on('response', () => {
38
resolve()
0 commit comments