rest-on-couch-client
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -30,2 +30,5 @@ import axios from 'axios'; | ||
this.url = config.url; | ||
if (!this.url.endsWith('/')) { | ||
this.url += '/'; | ||
} | ||
if (this.url.startsWith('/') && typeof window === 'object') { | ||
@@ -35,3 +38,3 @@ this.url = `${window.location.origin}${this.url}`; | ||
this.request = createAxios(this.url); | ||
this.dbUrl = new URL(`db/${config.database}/`, this.url).href; | ||
this.dbUrl = new URL(`db/${config.database}`, this.url).href; | ||
this.dbRequest = createAxios(this.dbUrl); | ||
@@ -38,0 +41,0 @@ } |
@@ -32,2 +32,5 @@ "use strict"; | ||
this.url = config.url; | ||
if (!this.url.endsWith('/')) { | ||
this.url += '/'; | ||
} | ||
if (this.url.startsWith('/') && typeof window === 'object') { | ||
@@ -37,3 +40,3 @@ this.url = `${window.location.origin}${this.url}`; | ||
this.request = createAxios(this.url); | ||
this.dbUrl = new URL(`db/${config.database}/`, this.url).href; | ||
this.dbUrl = new URL(`db/${config.database}`, this.url).href; | ||
this.dbRequest = createAxios(this.dbUrl); | ||
@@ -40,0 +43,0 @@ } |
{ | ||
"name": "rest-on-couch-client", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "A nodejs / browser client for rest-on-couch backend", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
212303
4806