Stop appending /v0 to HttpClient api endpoint urls

This commit is contained in:
Brandon Millman
2018-01-12 11:53:14 -08:00
parent c2c7512431
commit fbcbf066cd
3 changed files with 9 additions and 8 deletions

View File

@@ -2,8 +2,9 @@
## v0.x.x - _TBD, 2017_
* Sanitize api endpoint url and remove trailing slashes (#315)
* Improve error message text in HttpClient (#315)
* Sanitize api endpoint url and remove trailing slashes (#318)
* Improve error message text in HttpClient (#318)
* Stop appending '/v0' to api endpoint url in HttpClient (#318)
## v0.4.0 - _January 11, 2017_

View File

@@ -131,7 +131,7 @@ export class HttpClient implements Client {
const stringifiedParams = queryString.stringify(params);
query = `?${stringifiedParams}`;
}
const url = `${this._apiEndpointUrl}/v0${path}${query}`;
const url = `${this._apiEndpointUrl}${path}${query}`;
const headers = new Headers({
'content-type': 'application/json',
});

View File

@@ -39,7 +39,7 @@ describe('HttpClient', () => {
});
});
describe('#getTokenPairsAsync', () => {
const url = `${relayUrl}/v0/token_pairs`;
const url = `${relayUrl}/token_pairs`;
it('gets token pairs', async () => {
fetchMock.get(url, tokenPairsResponseJSON);
const tokenPairs = await relayerClient.getTokenPairsAsync();
@@ -61,7 +61,7 @@ describe('HttpClient', () => {
});
});
describe('#getOrdersAsync', () => {
const url = `${relayUrl}/v0/orders`;
const url = `${relayUrl}/orders`;
it('gets orders', async () => {
fetchMock.get(url, ordersResponseJSON);
const orders = await relayerClient.getOrdersAsync();
@@ -84,7 +84,7 @@ describe('HttpClient', () => {
});
describe('#getOrderAsync', () => {
const orderHash = '0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f';
const url = `${relayUrl}/v0/order/${orderHash}`;
const url = `${relayUrl}/order/${orderHash}`;
it('gets order', async () => {
fetchMock.get(url, orderResponseJSON);
const order = await relayerClient.getOrderAsync(orderHash);
@@ -100,7 +100,7 @@ describe('HttpClient', () => {
baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
quoteTokenAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
};
const url = `${relayUrl}/v0/orderbook?baseTokenAddress=${request.baseTokenAddress}&quoteTokenAddress=${
const url = `${relayUrl}/orderbook?baseTokenAddress=${request.baseTokenAddress}&quoteTokenAddress=${
request.quoteTokenAddress
}`;
it('gets order book', async () => {
@@ -125,7 +125,7 @@ describe('HttpClient', () => {
salt: new BigNumber('256'),
expirationUnixTimestampSec: new BigNumber('42'),
};
const url = `${relayUrl}/v0/fees`;
const url = `${relayUrl}/fees`;
it('gets fees', async () => {
fetchMock.post(url, feesResponseJSON);
const fees = await relayerClient.getFeesAsync(request);