简体   繁体   English

Node.js快速连接被/拒绝

[英]Node.js express connection refused with /

I am using node.js and express and trying to create a simple application that answers to the route 'localhost/games' on port 3000 我正在使用node.js并表达并尝试创建一个简单的应用程序,该应用程序在端口3000上回答路由“ localhost / games”

When I use the root index, 'localhost:3000' the application works fine. 当我使用根索引'localhost:3000'时,应用程序运行良好。 However, when I change this route to 'localhost/games:3000' I get connection refused with the exact same code. 但是,当我将此路由更改为“ localhost / games:3000”时,使用完全相同的代码拒绝连接。

Has anyone experienced this problem and know how to fix it? 有没有人遇到过这个问题,并且知道如何解决?

It does not have the right approach. 它没有正确的方法。 You need to do (localhost:port/foo) 您需要做(localhost:port / foo)

localhost:3000/games

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM