How to set up new ipfs-http-client new instance?
I have solution:
import { Injectable, InjectionToken, Inject } from '@angular/core';
import IpfsHttpClient from 'ipfs-http-client';
export const ipfsToken = new InjectionToken('The IPFS Token', {
providedIn: 'root',
factory: () => {
try {
return new IpfsHttpClient('ipfs.infura.io', '5001', {
protocol: 'https'
});
} catch (err) {
console.log('Error', err);
throw new Error('Unable to access IPFS node daemon on Infura network');
}
}
});
But I have an error This expression is not constructable