1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

api port tweaks

This commit is contained in:
Matthias Kretschmann 2019-10-07 13:06:24 +02:00
parent 8b31257837
commit 4920bae0fa
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 5 additions and 3 deletions

View File

@ -8,9 +8,9 @@ let ipfsMessage = ''
let ipfsVersion = '' let ipfsVersion = ''
export interface IpfsConfig { export interface IpfsConfig {
protocol: string
host: string host: string
port: string port: string
protocol: string
} }
export default function useIpfsApi(config: IpfsConfig) { export default function useIpfsApi(config: IpfsConfig) {

View File

@ -10,11 +10,13 @@ import Form from './Form'
const { hostname, port, protocol } = new URL(ipfsNodeUri) const { hostname, port, protocol } = new URL(ipfsNodeUri)
const ipfsConfig: IpfsConfig = { const ipfsConfig: IpfsConfig = {
protocol: protocol.replace(':', ''),
host: hostname, host: hostname,
port, port: port || '443'
protocol: protocol.replace(':', '')
} }
console.log(ipfsConfig)
export default function Ipfs({ addFile }: { addFile(url: string): void }) { export default function Ipfs({ addFile }: { addFile(url: string): void }) {
const { ipfs, isIpfsReady, ipfsError, ipfsMessage } = useIpfsApi(ipfsConfig) const { ipfs, isIpfsReady, ipfsError, ipfsMessage } = useIpfsApi(ipfsConfig)
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)