We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c18eed3 commit 957cd55Copy full SHA for 957cd55
src/index.js
@@ -37,7 +37,7 @@ export default function (app, configs = {}) {
37
38
methods.forEach((method) => {
39
obj[method] = function Method(path) {
40
- const req = superagent[method](`${url}${this.base}${path}`);
+ const req = superagent[method](`${url}${this.base}${path || ''}`);
41
if (listen) req._server = listen; // eslint-disable-line
42
43
this.configs.forEach(config => Object.keys(config).forEach((key) => {
@@ -53,7 +53,7 @@ export default function (app, configs = {}) {
53
obj.del = obj.delete;
54
55
obj.path = function Path(path) {
56
- return { ...this, base: `${this.base}${path}` };
+ return { ...this, base: `${this.base}${path || ''}` };
57
};
58
59
return obj;
0 commit comments