【问题标题】:Node.js express connection refused with /Node.js 快速连接被 / 拒绝
【发布时间】:2015-01-11 18:19:26
【问题描述】:

我正在使用 node.js 和 express 并尝试创建一个简单的应用程序来响应端口 3000 上的路由“localhost/games”

当我使用根索引时,'localhost:3000' 应用程序工作正常。但是,当我将此路由更改为 'localhost/games:3000' 时,我会使用完全相同的代码拒绝连接。

有没有人遇到过这个问题并知道如何解决?

【问题讨论】:

  • 应该是 localhost:3000/games,[port] 在 [host] 之后
  • 试试 localhost:3000/games
  • 谢谢!现在效果很好。

标签: node.js express routing


【解决方案1】:

它没有正确的方法。你需要做 (localhost:port/foo)

localhost:3000/games

【讨论】:

    猜你喜欢
    • 2015-04-26
    • 2021-06-05
    • 2014-03-18
    • 1970-01-01
    • 2017-08-08
    • 2016-08-16
    • 2021-06-01
    • 2020-06-04
    • 1970-01-01
    相关资源
    最近更新 更多