mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-27 05:56:21 +00:00
support specifying ipfs protocol in the storage provider
This commit is contained in:
parent
59678dd1fa
commit
bde067aabf
@ -10,7 +10,14 @@ __embarkIPFS.setProvider = function(options) {
|
||||
self.ipfsConnection = IpfsApi('localhost', '5001');
|
||||
self._getUrl = "http://localhost:8080/ipfs/";
|
||||
} else {
|
||||
self.ipfsConnection = IpfsApi(options.server, options.port);
|
||||
var ipfsOptions = {host: options.server, protocol: 'http'};
|
||||
if (options.protocol) {
|
||||
ipfsOptions.protocol = options.protocol;
|
||||
}
|
||||
if (options.port) {
|
||||
ipfsOptions.port = options.port;
|
||||
}
|
||||
self.ipfsConnection = IpfsApi(ipfsOptions);
|
||||
self._getUrl = options.getUrl || "http://localhost:8080/ipfs/";
|
||||
}
|
||||
resolve(self);
|
||||
|
Loading…
x
Reference in New Issue
Block a user