Many tutorials use the following to access IPFS:
const ipfsClient = require('ipfs-http-client')
const ipfs = ipfsClient({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' })
and than:
ipfs.add(buffer, (error, result) => {
I tried but it did not work for me. Maybe the versioning, maybe something else. That's why I resorted to :
const ipfsAPI = require('ipfs-api')
const ipfs = ipfsAPI('ipfs.infura.io', '5001', { protocol: 'https' })
If somebody know how to make the ipfsClient working, please let me know.