How to use the browser-sync.instance 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 azachar / screenshoter-report-analyzer / gulp / server.js View on Github external
var server = {
    baseDir: baseDir,
    routes: routes
  };

  /*
   * You can add a proxy to your backend by uncommenting the line below.
   * You just have to configure a context which will we redirected and the target url.
   * Example: $http.get('/users') requests will be automatically proxified.
   *
   * For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.9.0/README.md
   */
  // server.middleware = proxyMiddleware('/users', {target: 'http://jsonplaceholder.typicode.com', changeOrigin: true});

  browserSync.instance = browserSync.init({
    startPath: '/',
    server: server,
    browser: browser
  });
}
github flatlogic / angular-dashboard-seed / build / server.js View on Github external
function browserSyncInit(baseDir, files, browser) {
  browser = browser === undefined ? 'default' : browser;

  var routes = null;
  if (baseDir === 'src' || (util.isArray(baseDir) && baseDir.indexOf('src') !== -1)) {
    routes = {
      // Should be '/bower_components': '../bower_components'
      // Waiting for https://github.com/shakyShane/browser-sync/issues/308
      '/bower_components': 'bower_components',
      '/data': 'data'
    };
  }

  browserSync.instance = browserSync.init(files, {
    startPath: '/',
    server: {
      baseDir: baseDir,
      middleware: middleware,
      routes: routes
    },
    browser: browser
    //logLevel: 'debug'
  });

}
github TheIronYard--Orlando / FEE--2014--FALL / Dojos / 2014-11-19 / gulp / server.js View on Github external
function browserSyncInit(baseDir, files, browser) {
  browser = browser === undefined ? 'default' : browser;

  var routes = null;
  if(baseDir === 'src' || (util.isArray(baseDir) && baseDir.indexOf('src') !== -1)) {
    routes = {
      // Should be '/bower_components': '../bower_components'
      // Waiting for https://github.com/shakyShane/browser-sync/issues/308
      '/bower_components': 'bower_components'
    };
  }

  browserSync.instance = browserSync.init(files, {
    startPath: '/index.html',
    server: {
      baseDir: baseDir,
      middleware: middleware,
      routes: routes
    },
    browser: browser
  });

}
github Netflix / vector / gulp / server.js View on Github external
var server = {
    baseDir: baseDir,
    routes: routes
  };

  /*
   * You can add a proxy to your backend by uncommenting the line below.
   * You just have to configure a context which will we redirected and the target url.
   * Example: $http.get('/users') requests will be automatically proxified.
   *
   * For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.9.0/README.md
   */
  // server.middleware = proxyMiddleware('/users', {target: 'http://jsonplaceholder.typicode.com', changeOrigin: true});

  browserSync.instance = browserSync.init({
    startPath: '/',
    server: server,
    browser: browser
  });
}
github bullhorn / career-portal / build / server.js View on Github external
var server = {
        baseDir: baseDir,
        routes: routes
    };

    /*
     * You can add a proxy to your backend by uncommenting the line below.
     * You just have to configure a context which will we redirected and the target url.
     * Example: $http.get('/users') requests will be automatically proxified.
     *
     * For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.0.5/README.md
     */
    // server.middleware = proxyMiddleware('/users', {target: 'http://jsonplaceholder.typicode.com', proxyHost: 'jsonplaceholder.typicode.com'});

    browserSync.instance = browserSync.init({
        startPath: '/',
        server: server,
        browser: browser
    });
}
github tabixio / tabix / gulp / documentation.js View on Github external
gulp.task('docs', ['docs:generate'], function() {
	browserSync.use(browserSyncSpa({
		selector: '[ng-app]' // Only needed for angular apps
	}));

	browserSync.instance = browserSync.init({
		startPath: '/',
		server: {
			baseDir: './' + conf.paths.docs
		},
		port: 3010,
		browser: 'default'
	});
	gulp.watch(path.join(conf.paths.src, '/**/*.js'), function(event) {
		gulp.start('docs:generate');
		browserSync.reload(event.path);
	});
});
github tabixio / tabix / gulp / server.js View on Github external
/*
   * You can add a proxy to your backend by uncommenting the line below.
   * You just have to configure a context which will we redirected and the target url.
   * Example: $http.get('/users') requests will be automatically proxified.
   *
   * For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.9.0/README.md
   */
  // server.middleware = proxyMiddleware('/users', {target: 'http://jsonplaceholder.typicode.com', changeOrigin: true});


  server.middleware = proxyMiddleware('/api', {
      target: 'http://localhost:9798',
      changeOrigin: true
  });

  browserSync.instance = browserSync.init({
    startPath: '/',
    server: server,
    browser: browser
  });

  // Create a PHP Server
  phpServer.createServer({
      port: 9798,
      hostname: '127.0.0.1',
      base: '.',
      keepalive: false,
      open: false,
      bin: 'php',
      router: path.dirname(__dirname) + '/public/index.php'
  });
}
github Netflix / lemur / gulp / server.js View on Github external
function browserSyncInit(baseDir, files, browser) {
  browser = browser === undefined ? 'default' : browser;

  browserSync.instance = browserSync.init(files, {
    startPath: '/index.html',
      server: {
          middleware: [proxyMiddleware],
          baseDir: baseDir,
          routes: {
              '/bower_components': './bower_components'
          }
    },
    browser: browser,
    ghostMode: false
  });

}
github mohsen1 / swagger-docs / gulp / server.js View on Github external
function browserSyncInit(baseDir, files, browser) {
  browser = browser === undefined ? 'default' : browser;

  var routes = null;
  if(baseDir === paths.src || (util.isArray(baseDir) && baseDir.indexOf(paths.src) !== -1)) {
    routes = {
      '/bower_components': 'bower_components'
    };
  }

  browserSync.instance = browserSync.init(files, {
    startPath: '/',
    server: {
      baseDir: baseDir,
      middleware: middleware,
      routes: routes
    },
    browser: browser
  });
}
github 99xt-incubator / interns-portal / web / gulp / server.js View on Github external
/*
     * You can add a proxy to your backend by uncommenting the line below.
     * You just have to configure a context which will we redirected and the target url.
     * Example: $http.get('/users') requests will be automatically proxified.
     *
     * For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.9.0/README.md
     */
    server.middleware = proxyMiddleware('/dev', {
        target: 'https://lvf6nvg7n4.execute-api.us-east-1.amazonaws.com',
        changeOrigin: true,
        logLevel: 'info'

    });

    browserSync.instance = browserSync.init({
        startPath: '/',
        server: server,
        browser: browser,
        ghostMode: false
    });
}