Skip to content

Commit

Permalink
Merge pull request #69 from lenage/master
Browse files Browse the repository at this point in the history
Remove path prefix '/resource' for endpoint url
  • Loading branch information
Vijar committed Apr 8, 2015
2 parents 9cecc83 + f8347d4 commit 2913e2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion libs/fetcher.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ Queue.prototype = {
* @private
*/
_constructGetUri: function (uri, resource, params, config) {
var query = [], matrix = [], id_param = config.id_param, id_val, final_uri = uri + '/resource/' + resource;
var query = [], matrix = [], id_param = config.id_param, id_val, final_uri = uri + '/' + resource;
lodash.forEach(params, function (v, k) {
if (k === id_param) {
id_val = encodeURIComponent(v);
Expand Down
2 changes: 1 addition & 1 deletion libs/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function parseParamValues (params) {
var request;

if (req.method === GET) {
var path = req.path.substr(req.path.lastIndexOf('/resource/') + '/resource/'.length).split(';');
var path = req.path.substr(1).split(';');
request = {
req: req,
resource: path.shift(),
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/libs/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Server Fetcher', function () {
statusCodeSet = false,
req = {
method: 'POST',
path: '/resource/' + mockService.name,
path: '/' + mockService.name,
body: {
requests: {},
context: {
Expand Down Expand Up @@ -73,7 +73,7 @@ describe('Server Fetcher', function () {
statusCodeSet = false,
req = {
method: 'POST',
path: '/resource/' + mockService.name,
path: '/' + mockService.name,
body: {
requests: {
g0: {
Expand Down Expand Up @@ -127,7 +127,7 @@ describe('Server Fetcher', function () {
statusCodeSet = false,
req = {
method: 'POST',
path: '/resource/' + mockService.name,
path: '/' + mockService.name,
body: {
requests: {
g0: {
Expand Down Expand Up @@ -185,7 +185,7 @@ describe('Server Fetcher', function () {
statusCodeSet = false,
req = {
method: 'POST',
path: '/resource/' + mockErrorService.name,
path: '/' + mockErrorService.name,
body: {
requests: {
g0: {
Expand Down Expand Up @@ -243,7 +243,7 @@ describe('Server Fetcher', function () {
},
req = {
method: 'GET',
path: '/resource/' + mockService.name + ';' + qs.stringify(params, ';')
path: '/' + mockService.name + ';' + qs.stringify(params, ';')
},
res = {
json: function(response) {
Expand Down Expand Up @@ -283,7 +283,7 @@ describe('Server Fetcher', function () {
},
req = {
method: 'GET',
path: '/resource/' + mockService.name + ';' + qs.stringify(params, ';')
path: '/' + mockService.name + ';' + qs.stringify(params, ';')
},
res = {
json: function(response) {
Expand Down Expand Up @@ -323,7 +323,7 @@ describe('Server Fetcher', function () {
statusCodeSet = false,
req = {
method: 'GET',
path: '/resource/' + mockErrorService.name + ';' + qs.stringify(params, ';')
path: '/' + mockErrorService.name + ';' + qs.stringify(params, ';')
},
res = {
json: function(response) {
Expand Down

0 comments on commit 2913e2c

Please sign in to comment.