diff --git a/src/js/components/ipfs.js b/src/js/components/ipfs.js index c9ff84d9e..4b07aea38 100644 --- a/src/js/components/ipfs.js +++ b/src/js/components/ipfs.js @@ -6,7 +6,7 @@ const host = (process.env.NODE_ENV !== 'production') ? 'localhost' : window.loca const port = (process.env.NODE_ENV !== 'production') ? '5001' : (window.location.port || (window.location.protocol === 'https:' ? 443 : 80)) const protocol = (process.env.NODE_ENV !== 'production') ? 'http' : (window.location.protocol === 'https:' ? 'https' : 'http') -const ipfs = require('ipfs-api')(host, port, protocol) +const ipfs = require('ipfs-api')(host, port, {protocol: protocol}) let version = '' let gateway = '//127.0.0.1:8080' diff --git a/src/js/services/api.js b/src/js/services/api.js index 5cd50d43a..3b0b9b6ca 100644 --- a/src/js/services/api.js +++ b/src/js/services/api.js @@ -4,7 +4,9 @@ import {join} from 'path' const host = (process.env.NODE_ENV !== 'production') ? 'localhost' : window.location.hostname const port = (process.env.NODE_ENV !== 'production') ? '5001' : (window.location.port || (window.location.protocol === 'https:' ? 443 : 80)) -const localApi = new API(host, port) +const protocol = (process.env.NODE_ENV !== 'production') ? 'http' : (window.location.protocol === 'https:' ? 'https' : 'http') + +const localApi = new API(host, port, {protocol: protocol}) // -- Public Interface