0

我有一个 Windows 系统;

cordova 7.0.1
ionic 3.3.0
npm 3.10.8
gulp 3.9.1

我正在尝试将 Ionic Serve 配置为 localhost 而不是 0.0.0.0 默认值,因为它返回 Access Denied 错误。在以前的版本中,我能够添加

"ank": "...",
"versionCheck": 1413143560174,
"ionicServeAddress": "localhost"

到 ionic config.file ,但这似乎无济于事。此外,我尝试过使用离子地址来更改它,但这似乎不是一个选择。

有没有办法配置默认地址而不在 ionic serve 命令中添加它?

编辑 .ionic/config.json

{
  "ank": "...",
  "versionCheck": 1413143560174,
  "ionicServeAddress": "localhost",
  "lastCommand": "2017-06-05T22:15:31.825Z",
  "urls": {
    "api": "https://api.ionic.io",
    "dash": "https://apps.ionic.io"
  },
  "user": {},
  "tokens": {
    "appUser": {},
    "telemetry": "afac6034-bb58-4e95-9f1f-035a90625f05"
  },
  "cliFlags": {
    "confirm": false,
    "interactive": true,
    "telemetry": true,
    "yarn": false,
    "timeout": true
  }
}

我有一个运行的 gulp 任务

ionic serve

gulp serve 命令的基本流程

deploy:watch (start)
clean:dest
preproccess (various)
gulp-notify: Generate bundle.js
copy: (various)
watch: (various)
deploy:watch (finish)
serve
Starting server: --port=8100 --p=8100 --livereload-port=35729 --r=35729 --address=0.0.0.0
4

0 回答 0