I use gulp -connect, I have all my .html files in the project root directory.
This is my gruntfile.js
var gulp = require('gulp');
var connect = require('gulp-connect');
gulp.task('connect', connect.server({
root: '/',
port: 8000,
livereload: true,
open: {
file: 'index.html'
}
}));
I tried root: '', root: '.'and also did not declare anything, they all did not work with a 404-page error, but if I moved my .html to a subdirectory such as dist and declare root: 'dist', it worked.
Please help how to configure the connect.server () root option to search for files in the project root directory?
Thank.
source
share