Created
May 5, 2019 02:30
-
-
Save alexytiger/92dacfb980ec11e1f2bef089b25735fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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