DennyHiu
DennyHiu

Reputation: 6060

Gulp-connect with Express server?

How to configure gulp-connect to run file at bin/www (express)? I can't make it work, I find no documentation on gulp-connect site that deal with config/change the starting file used by gulp-connect.

var gulp = require('gulp'),
connect = require('gulp-connect');

gulp.task('webserver', function() {
    connect.server({
        root: 'app',
        livereload: true
    });
});

gulp.task('default', ['webserver']);

Upvotes: 1

Views: 462

Answers (1)

Jammi
Jammi

Reputation: 177

Why are using you using both "Express" and "gulp-connect" ?

You should just stick to one. Assign root : bin/www and it should work or root: [__dirname]

Alternatively use:

path = require('path') and then root: path.resolve('./')

Upvotes: 0

Related Questions