How to use the ipfsd-ctl.disposableApi function in ipfsd-ctl

To help you get started, we’ve selected a few ipfsd-ctl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fazo96 / ipfs-boards / gulpfile.js View on Github external
gulp.task('ipfs', function(done){
  console.log(server.port)
  //'API.HTTPHeaders.Access-Control-Allow-Origin': '*'
  var opt = {
    'Addresses.API': '/ip4/127.0.0.1/tcp/5001',
    'API': {
      'HTTPHeaders': {
        'Access-Control-Allow-Origin': [
          '*'
        ]
      }
    }
  }
  console.log(opt)
  ipfsd.disposableApi(opt,(err, ipfs) => {
    ipfs.id(function (err, id) {
      if(err) return console.log('Failed to start IPFS:',err)
      console.log('Started IPFS Daemon')
      //done()
    })
  })
})