Skip to content

Instantly share code, notes, and snippets.

@tonydieu
Created March 20, 2015 08:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonydieu/4df749b6c2576c7813b3 to your computer and use it in GitHub Desktop.
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();
}
}
});
});
@TeodorKolev
Copy link

Not working.

@ohot2015
Copy link

not working

@onuralpb
Copy link

not working

@nicosli
Copy link

nicosli commented Mar 23, 2018

not working

@jessedvrs
Copy link

combo-breaker

@Hossein-rezaei
Copy link

not working

@pedrohenriquebr
Copy link

not working

@enoh-barbu
Copy link

not working

@NaClnik
Copy link

NaClnik commented Jun 22, 2021

not working

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