Skip to content

Instantly share code, notes, and snippets.

@tonydieu
Created March 20, 2015 08:53
Show Gist options
  • Select an option

  • Save tonydieu/4df749b6c2576c7813b3 to your computer and use it in GitHub Desktop.

Select an option

Save tonydieu/4df749b6c2576c7813b3 to your computer and use it in GitHub Desktop.
How-to: Enable CORS in Browsersync
// https://hondo.wtf/2015/02/15/enable-cors-in-browsersync
gulp.task('browser-sync', function () {
browserSync({
notify: false,
port: 6543,
server: {
baseDir: config.dest,
middleware: function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
}
}
});
});
@ryanaltvater
Copy link

not working

@enoh-barbu
Copy link

still not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment