简体   繁体   中英

Gulp server doesn't work

I'm using Gulp and I've installed gulp-livereload and gulp-connect to set up a development server. Here's my gulpfile.js :

"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
  });
});

When I run gulp connect in my shell, the server does start on localhost:8080 , but when I try to navigate to it, it returns me a 404 error. I'm working on Win10 and use Microsoft Edge. What have I done wrong?

假设你在app/index.html有一个 index.html 文件,那个 gulp 文件没有问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM