O
O
olta782017-04-28 18:51:17
gulp.js
olta78, 2017-04-28 18:51:17

When running gulp watch in a browser, Cannot GET /?

Hello! Help me understand what's going on here? I run gulp watch in the browser and the message is Cannot GET/
Here is the complete golpfile:

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

gulp.task('sass', function() {
  return gulp.src('app/sass/**/*.sass')
    .pipe(sass())
    .pipe(gulp.dest('app/css'))
    .pipe(browserSync.reload({stream: true}))
});

gulp.task('browser-sync', function() {
  browserSync ({
    server: {
      baseDir: 'app'
    },
    notify: false
  });
});

gulp.task('watch', ['browser-sync', 'sass'], function() {
  gulp.watch('app/sass/**/*.sass', ['sass']);
  gulp.watch('app/*.html', browserSync.reload);
  gulp.watch('app/js/**/*.js', browserSync.reload);
});

Thanks in advance!!!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tarasenkovlady, 2018-08-08
@tarasenkovlady

In my case, after the name of the localhost, it was necessary to add a specific page
localhost:8000/front-page.html

M
Mary Solar, 2017-04-28
@MaryT

I also learned the same lessons, by the way. Did you run other tasks before launching gulp watch?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question