gulp 配置http-proxy-middleware 后请求不到本地目录的文件
使用http://localhost:3000/打不开本地index.html了
gulp.task('browserSync', function() {
browserSync({
server: {
baseDir: 'app',
middleware: function(connect, opt) {
return [
proxy('/api', {
target: 'http://192.168.0.195/',
changeOrigin: true,
pathRewrite: {
'^/api/' : 'yuequ', // rewrite path
}
})
]
}
}
})
})