How to enable basic authentication for a web server using gulp browser sync?

Our web application uses the REST API, which requires basic authentication.

I want to write a sync gulp task for a browser as follows:

gulp.task('browser-sync', function() { browserSync({ server: { baseDir: './' }, authenticate: 'authentication-token-here-djfhjsdfjsgdf' }); }); 

How can this be set up?

+6
source share

Source: https://habr.com/ru/post/973391/


All Articles