【发布时间】: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
-
谢谢!现在效果很好。