【问题标题】:grunt-contrib-connect: Only root is reachable, only on CI servergrunt-contrib-connect: 只有 root 可以访问,只能在 CI 服务器上
【发布时间】:2015-01-06 23:29:24
【问题描述】:

我一直在用头撞墙,试图弄清楚发生了什么,我希望有人能提供帮助。

我正在使用grunt-contrib-connect 启动一个静态服务器来运行 mocha 规范,而不是使用 selenium。在本地 OS X 10.10 上,一切正常。太棒了。

但是,在 CI(信号量)上,服务器启动,规范开始运行,第一个命中 / 的规范顺利通过。但是,连接到/path/to/html/ 的下一个规范都失败了。我提出了一些curl 请求,看看这是否只是一个测试问题,我可以curl http://localhost:3023 工作正常,curl http://localhost:3023/path/to/html/ 404s。这些文件正是它们应该在的位置,就像我说的那样,这一切都在我的本地机器上运行。

任何想法可能会发生什么?这是我的咕噜声配置:

connect: { options: { port: 4000, hostname: 'localhost', livereload: 35729 }, livereload: { options: { middleware: function(connect) { return [ // Load the middleware provided by the livereload plugin // that will take care of inserting the snippet require('grunt-contrib-livereload/lib/utils').livereloadSnippet, connect.bodyParser(), connect.static(paths.dist.root) ]; } } }, test: { options: { port: 3023, host: '*', base: paths.dist.root, livereload: false, debug: true, directory: paths.dist.root, middleware: function(connect) { return [ connect.static(paths.dist.root) ]; } } }, dist: { options: { port: 1338, open: 'http://localhost:1338/', base: paths.dist.root, livereload: false, keepalive: true } } },

我正在为测试任务打电话给connect:test。任何帮助将不胜感激。

【问题讨论】:

    标签: node.js grunt-contrib-connect


    【解决方案1】:

    问题是大写....叹息。 url 路径有大写字母,OS X 不关心,但 Ubuntu 关心。更改此设置后,一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-25
      • 2014-09-03
      • 1970-01-01
      • 2014-12-29
      • 1970-01-01
      • 1970-01-01
      • 2017-12-23
      • 1970-01-01
      相关资源
      最近更新 更多