gulp-server-livereload
gulp-server-livereload copied to clipboard
defaultFile not setting path
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/ ).
Not a bad idea. PR welcome.