The Right Code

Home of Greg Bergé. Let's speak about JavaScript.

Gulp simplest local server ever

I search a lot of things to simply run a local server using gulp and finally I found BrowserSync. This is the simplest way I found to run a local server using gulp.

var gulp = require('gulp');  
var browserSync = require('browser-sync');

// Static server.
gulp.task('browser-sync', function() {  
  browserSync({
    server: {
      baseDir: './'
    }
  });
});

gulp.task('default', ['browser-sync']);  

You can find more details on BrowserSync documentation.

comments powered by Disqus