Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gulp Connect not running server

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?

like image 882
dazer Avatar asked Jul 11 '14 21:07

dazer


2 Answers

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.

like image 182
Victor Axelsson Avatar answered Oct 09 '22 17:10

Victor Axelsson


gulp-connect has been deprecated.

You may wish to use the rewritten package called gulp-webserver.

like image 38
RustyFluff Avatar answered Oct 09 '22 16:10

RustyFluff