Add ability to configure Secure API (for #4885) (#4922)

This commit is contained in:
Nicolas Gotchac 2017-03-15 19:15:05 +01:00 committed by Gav Wood
parent 8d16cdf12f
commit ba07c32300

View File

@ -92,6 +92,26 @@ export default class SecureApi extends Api {
return this._transport.token; 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 () { connect () {
if (this._isConnecting) { if (this._isConnecting) {
return; return;