mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-10 20:56:38 +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.ipfsConnection = IpfsApi('localhost', '5001');
|
||||||
self._getUrl = "http://localhost:8080/ipfs/";
|
self._getUrl = "http://localhost:8080/ipfs/";
|
||||||
} else {
|
} 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/";
|
self._getUrl = options.getUrl || "http://localhost:8080/ipfs/";
|
||||||
}
|
}
|
||||||
resolve(self);
|
resolve(self);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user