I created the gulpfile.js and in it has a use for gulp-connect
gulp.task('connect', function(){
connect.server({
root: 'dev',
livereload: true,
port: 8000
});
})
When I run gulp connect
it does not maintain my server on localhost:8000
.
[14:08:51] Starting 'connect'...
[14:08:51] Server started http://localhost:8000
[14:08:51] LiveReload started on port 35729
[14:08:51] Finished 'connect' after 13 ms
Hence I get nothing when opening up http://locahost:8000
What can I do to make connect work and create a server to deploy my html?
I had the same problem and I resolved it by having more than one file in the served folder (my dist directory). I don't know why it works but it started working after that.
I used the following settings:
gulp.task('connect', function(){
connect.server({
root: ['dist'],
port: 8000,
base: 'http://localhost',
livereload: true
});
I use v2.2.0 of gulp-connect.
gulp-connect has been deprecated.
You may wish to use the rewritten package called gulp-webserver.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With