Skip to content

Commit

Permalink
Added support for using a proxy server
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraFiedler committed Jun 21, 2017
1 parent 1d08e9e commit 2fca809
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/api-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ class ApiClient {
* @param {string} databaseId - ID of your database
* @param {string} secretToken - Corresponding secret token
* @param {boolean} alwaysUseHttps - If true, all requests are sent using HTTPS (default: false)
* @param {Object} options - Other custom options
*/
constructor (databaseId, token, alwaysUseHttps) {
constructor (databaseId, token, alwaysUseHttps, options) {
this.databaseId = databaseId;
this.token = token;
this.alwaysUseHttps = alwaysUseHttps;
this.baseUri = process.env.RAPI_URI || 'rapi.recombee.com';
this.options = options || {};
}

/**
Expand All @@ -46,6 +48,9 @@ class ApiClient {
json: true
};

if (this.options.proxy)
options.proxy = this.options.proxy;

if (request.bodyParameters())
options.body = request.bodyParameters();

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "recombee-api-client",
"version": "1.3.2",
"version": "1.3.3",
"description": "Node.js client (SDK) for easy use of the Recombee recommendation API",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 2fca809

Please sign in to comment.