Closed nhunzaker closed 8 years ago
This PR adds relative path calculation such that the following configuration:
var api = new Gangway({ baseUrl: 'https://example.com/bar', }) api.route({ exceptionToRules: { path: '/deviant' } })
Will send a request to https://example.com/deviant. Additionally:
https://example.com/deviant
var api = new Gangway({ baseUrl: 'https://example.com', }) api.namespace('users').route({ read: { path: '{id}' } })
Would produce a request to https://example.com/users/{id}.
https://example.com/users/{id}
This should be more intuitive, and allow for more flexibility in path handling.
:+1: nice tests
:+1:
This PR adds relative path calculation such that the following configuration:
Will send a request to
https://example.com/deviant
. Additionally:Would produce a request to
https://example.com/users/{id}
.This should be more intuitive, and allow for more flexibility in path handling.