【发布时间】:2020-02-28 04:17:58
【问题描述】:
我一直在尝试使用 gulp 使 browsersync 在 vagrant 中工作。我可以连接到 browsersync 的 UI,但我永远无法连接到我的开发站点。如果尝试使用地址http://localhost:3000 连接,我不断收到以下错误:
Cannot GET /
这是我对 vagrant 的配置:
# IP Address to access the server 10.0.0.3
config.vm.network "private_network", ip: "10.0.0.3"
config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true
config.vm.network "forwarded_port", guest: 3001, host: 3001, auto_correct: true
# Sync the server timezone to the host machine
config.vm.provision :shell, :inline => "sudo rm /etc/localtime && sudo ln -s /usr/share/zoneinfo/Asia/Manila /etc/localtime", run: "always"
# Sync File
config.vm.synced_folder "./", "/var/www/html", mount_options: ["dmode=777", "fmode=666"]
连接SQL时的配置
这是我对 Gulp 的配置:
browserSync.init(["./assets/css/*.css"],{
server: {
proxy: "http://10.0.0.3/globe-gui/",
open: false,
port: "2222",
injectChanges: true,
}
});
我尝试在网上搜索解决方案,但似乎无法得到答案。
【问题讨论】:
-
"我可以连接到 browsersync 的 UI" 你是怎么连接的?在主人还是客人?到什么地址?
-
@OluwafemiSule 对于 UI,我可以使用以下地址进行连接 - localhost:3001
标签: gulp vagrant browser-sync