Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Created May 5, 2019 02:30
Show Gist options
  • Save alexytiger/92dacfb980ec11e1f2bef089b25735fe to your computer and use it in GitHub Desktop.
Save alexytiger/92dacfb980ec11e1f2bef089b25735fe to your computer and use it in GitHub Desktop.
export const ipfsToken = new InjectionToken('The IPFS Token', {
providedIn: 'root',
factory: () => {
try {
return new (window as any).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');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment