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:
parent
8b31257837
commit
4920bae0fa
@ -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) {
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user