From f9b29d35bab8322fc5b9a0442d889427839ae232 Mon Sep 17 00:00:00 2001 From: Khaled Garbaya Date: Thu, 7 Jul 2016 14:25:46 +0200 Subject: [PATCH] feat(contentful): Introduce createClientWithCustomHttpVendor Introduc a way of creating a client with custom http vendor instance --- browser.js | 6 ++++++ index.js | 6 ++++++ package.json | 1 - 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/browser.js b/browser.js index 24b668112..568d1ca67 100644 --- a/browser.js +++ b/browser.js @@ -4,5 +4,11 @@ var contentful = require('./dist/contentful').default module.exports = { createClient: function (params) { return contentful(axios, params) + }, + // This is intended to be used only for debug reasons + // e.g: if you want to add interceptor to axios or if you want to use a different vendor + // if you want to use a different vendor than axios make sure it is using promises + createClientWithCustomHttpVendor: function (httpVendor, params) { + return contentful(httpVendor, params) } } diff --git a/index.js b/index.js index a8d5d4fd3..62276c5a7 100644 --- a/index.js +++ b/index.js @@ -16,5 +16,11 @@ try { module.exports = { createClient: function (params) { return contentful(axios, params) + }, + // This is intended to be used only for debug reasons + // e.g: if you want to add interceptor to axios or if you want to use a different vendor + // if you want to use a different vendor than axios make sure it is using promises + createClientWithCustomHttpVendor: function (httpVendor, params) { + return contentful(httpVendor, params) } } diff --git a/package.json b/package.json index 36335c495..4a8a7f931 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,5 @@ { "name": "contentful", - "version": "1.0.0-determined-by-semantic-release", "description": "Client for Contentful's Content Delivery API", "homepage": "https://www.contentful.com/developers/documentation/content-delivery-api/", "main": "index.js",