【问题标题】:grunt-contrib-connect and access denied pagegrunt-contrib-connect 和访问被拒绝页面
【发布时间】:2014-09-19 15:32:20
【问题描述】:

我正在为我的 angularJs 项目使用 grunt-contrib-connect(package.json 中的 ^0.8.x)。

当我开始任务 grunt connect 我的外壳说:

Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://0.0.0.0:8000

我的浏览器在http://0.0.0.0:8000 上打开一个新标签页,但我有一个拒绝访问页面

这是我的代码:

 connect: {
        server: {
            options: {
                keepalive: true,
                debug: true,
                open: {
                    target: 'http://localhost:8000'
                }
            }
        }
    }

我是 mac 用户 10.9.5

我使用windows XP的朋友没有这个问题。

你有想法吗?

【问题讨论】:

    标签: javascript angularjs gruntjs grunt-contrib-connect


    【解决方案1】:

    您的服务器上缺少base 参数。没有它,connect 不知道它应该从哪个目录提供文件。

    connect: {
        server: {
            options: {
                keepalive: true,
                debug: true,
                base: "path/to/source",
                open: true
            }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2015-01-25
      • 2011-10-04
      • 2019-01-08
      • 1970-01-01
      • 2016-03-14
      • 1970-01-01
      • 1970-01-01
      • 2015-06-30
      • 2023-03-16
      相关资源
      最近更新 更多