From ba07c32300c300dfa9324cf7cf5a233976b8241c Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Wed, 15 Mar 2017 19:15:05 +0100 Subject: [PATCH] Add ability to configure Secure API (for #4885) (#4922) --- js/src/secureApi.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/js/src/secureApi.js b/js/src/secureApi.js index fcd7f5fe2..60983fce1 100644 --- a/js/src/secureApi.js +++ b/js/src/secureApi.js @@ -92,6 +92,26 @@ export default class SecureApi extends Api { return this._transport.token; } + /** + * Configure the current API with the given values + * (`signerPort`, `dappsInterface`, `dappsPort`, ...) + */ + configure (configuration) { + const { dappsInterface, dappsPort, signerPort } = configuration; + + if (dappsInterface) { + this._dappsInterface = dappsInterface; + } + + if (dappsPort) { + this._dappsPort = dappsPort; + } + + if (signerPort) { + this._signerPort = signerPort; + } + } + connect () { if (this._isConnecting) { return;