gulp-server-livereload icon indicating copy to clipboard operation
gulp-server-livereload copied to clipboard

defaultFile not setting path

Open aciccarello opened this issue 9 years ago • 1 comments

I have a gulp task in which I'm trying to automatically open a file in the app directory of my project from the root. However, the browser simply opens localhost:8000 displaying the index.html file. Because the browser url is not set to contain the app directory, the included CSS and JS files are not loaded.

Task:

gulp.task('start', start);
/** Start app with the live reload server */
function start() {
  gulp.src(paths.root)
    .pipe(server({
      livereload: false,
      defaultFile: '/app/index.html',
      open: true
    }));
};

It appears that the server serves the default file when a request is made for the root of the server (localhost:8000). I would like to be able to have the browser load One solution I can think of is a defaultPath option which would open the browser to something other than the root.

Note: The reason I'm not starting the webserver on the app directory is because I have other directories of the project which I want access to (such as docs/ ).

aciccarello avatar Apr 10 '15 14:04 aciccarello

Not a bad idea. PR welcome.

hiddentao avatar Apr 13 '15 08:04 hiddentao