【问题标题】:How do I change URL when running grunt serve?运行 grunt serve 时如何更改 URL?
【发布时间】:2014-08-13 18:55:49
【问题描述】:

我正在使用 Yeoman 并使用 grunt serve 在浏览器中查看应用程序。

服务器从http://myhost.com:9000 开始,但我想知道是否可以改为从http://myhost.com:9000/hello 开始。

我查看了文档以在 Gruntfile 中找到要更改的内容,但找不到任何有用的内容。

【问题讨论】:

    标签: gruntjs yeoman


    【解决方案1】:

    通过添加open 选项,您可以配置要在浏览器中打开的 URL。

    task: {
      options: {
        port: 9000,
        open: {
          target: 'http://myhost.com:9000/hello'
        }
      }
    }
    

    【讨论】:

    • 我要添加的是 /hello 部分到 url。
    猜你喜欢
    • 2017-04-25
    • 1970-01-01
    • 1970-01-01
    • 2015-01-13
    • 1970-01-01
    • 1970-01-01
    • 2014-06-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多