gulp配置时使用http-proxy-middleware做代理,有人知道怎么配置多重代理吗?
gulp.task('server', function() {
connect.server({
livereload: true,
root: "./output",
port: 8080,
middleware: function(connect, opt) {
return [
proxy('/test',{
target: 'http://localhost:8000',
changeOrigin: true,
})
]
}
});
});
return doesn’t return an array, try writing more proxies
Official example:
https://github.com/chimurai/h...
@hjzheng It’s the same, but the proxy is written separately
Then configure middleware: [proxy1, proxy2] like this