Skip to content

Commit 2913e2c

Browse files
committed
Merge pull request #69 from lenage/master
Remove path prefix '/resource' for endpoint url
2 parents 9cecc83 + f8347d4 commit 2913e2c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

libs/fetcher.client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ Queue.prototype = {
290290
* @private
291291
*/
292292
_constructGetUri: function (uri, resource, params, config) {
293-
var query = [], matrix = [], id_param = config.id_param, id_val, final_uri = uri + '/resource/' + resource;
293+
var query = [], matrix = [], id_param = config.id_param, id_val, final_uri = uri + '/' + resource;
294294
lodash.forEach(params, function (v, k) {
295295
if (k === id_param) {
296296
id_val = encodeURIComponent(v);

libs/fetcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function parseParamValues (params) {
9393
var request;
9494

9595
if (req.method === GET) {
96-
var path = req.path.substr(req.path.lastIndexOf('/resource/') + '/resource/'.length).split(';');
96+
var path = req.path.substr(1).split(';');
9797
request = {
9898
req: req,
9999
resource: path.shift(),

tests/unit/libs/fetcher.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('Server Fetcher', function () {
4040
statusCodeSet = false,
4141
req = {
4242
method: 'POST',
43-
path: '/resource/' + mockService.name,
43+
path: '/' + mockService.name,
4444
body: {
4545
requests: {},
4646
context: {
@@ -73,7 +73,7 @@ describe('Server Fetcher', function () {
7373
statusCodeSet = false,
7474
req = {
7575
method: 'POST',
76-
path: '/resource/' + mockService.name,
76+
path: '/' + mockService.name,
7777
body: {
7878
requests: {
7979
g0: {
@@ -127,7 +127,7 @@ describe('Server Fetcher', function () {
127127
statusCodeSet = false,
128128
req = {
129129
method: 'POST',
130-
path: '/resource/' + mockService.name,
130+
path: '/' + mockService.name,
131131
body: {
132132
requests: {
133133
g0: {
@@ -185,7 +185,7 @@ describe('Server Fetcher', function () {
185185
statusCodeSet = false,
186186
req = {
187187
method: 'POST',
188-
path: '/resource/' + mockErrorService.name,
188+
path: '/' + mockErrorService.name,
189189
body: {
190190
requests: {
191191
g0: {
@@ -243,7 +243,7 @@ describe('Server Fetcher', function () {
243243
},
244244
req = {
245245
method: 'GET',
246-
path: '/resource/' + mockService.name + ';' + qs.stringify(params, ';')
246+
path: '/' + mockService.name + ';' + qs.stringify(params, ';')
247247
},
248248
res = {
249249
json: function(response) {
@@ -283,7 +283,7 @@ describe('Server Fetcher', function () {
283283
},
284284
req = {
285285
method: 'GET',
286-
path: '/resource/' + mockService.name + ';' + qs.stringify(params, ';')
286+
path: '/' + mockService.name + ';' + qs.stringify(params, ';')
287287
},
288288
res = {
289289
json: function(response) {
@@ -323,7 +323,7 @@ describe('Server Fetcher', function () {
323323
statusCodeSet = false,
324324
req = {
325325
method: 'GET',
326-
path: '/resource/' + mockErrorService.name + ';' + qs.stringify(params, ';')
326+
path: '/' + mockErrorService.name + ';' + qs.stringify(params, ';')
327327
},
328328
res = {
329329
json: function(response) {

0 commit comments

Comments
 (0)