Skip to content

Commit

Permalink
fix(Node): Do not throw error if internalUrl not provided. Instead …
Browse files Browse the repository at this point in the history
…use `url` (#503)
  • Loading branch information
nduchak committed Jun 21, 2019
1 parent 34b7e52 commit 053faae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions es/node.js
Expand Up @@ -102,9 +102,9 @@ function axiosError (handler) {
*/
const Node = stampit({
async init ({ url = this.url, internalUrl = this.internalUrl, axiosConfig: { config, errorHandler } = {} }) {
if (!url || !internalUrl) throw new Error('"url" and "internalUrl" required')
if (!url) throw new Error('"url" required')
url = url.replace(/\/?$/, '')
internalUrl = internalUrl.replace(/\/?$/, '')
internalUrl = internalUrl ? internalUrl.replace(/\/?$/, '') : url
// Get swagger schema
const swag = await remoteSwag(url, config).catch(this.axiosError(errorHandler))
this.version = swag.info.version
Expand Down

0 comments on commit 053faae

Please sign in to comment.