How to use the browser-sync.bind function in browser-sync

To help you get started, we’ve selected a few browser-sync 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 google / ioweb2015 / gulp_scripts / backend.js View on Github external
var args = [
    'preview', 'app', 'run', opts.dir,
    '--host', serverAddr,
    '--datastore-path', IOWA.backendDir + '/.gae_datastore'
  ];

  var backend = spawn('gcloud', args, {stdio: 'inherit'});
  if (!opts.reload) {
    console.log('The app should now be available at: ' + url);
    backend.on('close', callback);
    return url;
  }

  browserSync.emitter.on('service:exit', callback);
  // give GAE server some time to start
  setTimeout(browserSync.bind(null, {notify: false, open: false, port: 3000, proxy: serverAddr}), 2000);
  return 'http://localhost:3000' + IOWA.urlPrefix;
}