本地用tomcat开了个服务器,所有项目都跑在上面。
现在想用gulp搭个环境,实现自动刷新,但是不起作用。
求问怎么解决啊
PHPz2017-04-17 16:10:32
You need to use the proxy
parameter of Browsersync. proxy
参数。
比如你 Tomcat 的地址是 127.0.0.1:8080
,需要将这个地址代理,如:
gulp.task('browser-sync', function() {
browserSync.init({
proxy: "127.0.0.1:8080"
});
});
最后还是访问 Browsersync 的地址就可以了 127.0.0.1:3000
127.0.0.1:8080
, you need to proxy this address, such as: 🎜
rrreee
🎜Finally, just visit the Browsersync address 127.0.0.1:3000
🎜