mirror of https://github.com/embarklabs/embark.git
Fix loading swarm-api in node or browser
This commit is contained in:
parent
c22901ab95
commit
583318169a
|
@ -1,6 +1,9 @@
|
|||
/*global web3 */
|
||||
let __embarkSwarm = {_swarmConnection: undefined};
|
||||
const SwarmAPI = require('swarm-api');
|
||||
let SwarmAPI = require('swarm-api');
|
||||
if (SwarmAPI.default) {
|
||||
SwarmAPI = SwarmAPI.default;
|
||||
}
|
||||
|
||||
__embarkSwarm.setProvider = function (options) {
|
||||
let protocol = options.protocol || 'http';
|
||||
|
|
Loading…
Reference in New Issue