2016-09-19 57 views
-1

我正在使用Gulp,並且我安裝了gulp-livereloadgulp-connect來設置開發服務器。這裏是我的gulpfile.jsGulp服務器不起作用

"use strict"; 
const gulp = require('gulp'); 
const livereload = require('gulp-livereload'); 
const connect = require('gulp-connect'); 

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

當我在shell中運行gulp connect,服務器也開始localhost:8080,但是當我試圖來找到它,它返回我一個404錯誤。我正在使用Win10並使用Microsoft Edge。我做錯了什麼?

+2

你能告訴我們什麼是應用程序目錄(有一個index.html文件)index.html文件,前提是一飲而盡文件? – Nix

+0

請發帖作爲答案,這是問題 - 我沒有用'index.html'製作一個'app'目錄。我的壞:( – AlexNikolaev94

+0

@Nix謝謝!我可以在8分鐘內接受它 – AlexNikolaev94

回答

0

沒有什麼錯用,你必須在app/index.html