Skip to content

Commit

Permalink
feat: switch to v3 endpoints on Iris
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Apr 28, 2021
1 parent f81cd3a commit eca6697
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/node-pool/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ export const NodePool = stampit({
get () {
return getterForCurrentNode(this.selectedNode)
}
},
_isIrisNode: {
enumerable: true,
configurable: false,
get () {
return this.selectedNode.instance._isIrisNode
}
}
},
methods: {
Expand Down
6 changes: 5 additions & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ const Node = AsyncInit.compose({
if (!url) throw new Error('"url" required')
this.url = url.replace(/\/$/, '')
this.internalUrl = internalUrl ? internalUrl.replace(/\/$/, '') : this.url
const client = await genSwaggerClient(`${this.url}/api`, { internalUrl: this.internalUrl })
let client = await genSwaggerClient(`${this.url}/api`, { internalUrl: this.internalUrl })
if (client.spec.info.version.split('-')[0] === '0.0.0') {
client = await genSwaggerClient(`${this.url}/api?oas3`, { internalUrl: this.internalUrl })
this._isIrisNode = true
}
this.version = client.spec.info.version
this.api = client.api
},
Expand Down

0 comments on commit eca6697

Please sign in to comment.