I have just configured node.js, and express on a new linux server running Ubuntu. I have connected to the server via a console and done everything there. I have finally run my new web app made with express, how can i view it in my own computers browser?
我刚刚配置了node.js,并在运行Ubuntu的新Linux服务器上表达。我通过控制台连接到服务器并完成了所有操作。我终于运行了用express制作的新网页应用程序,如何在自己的计算机浏览器中查看?
Thanks
1 个解决方案
#1
0
Step 1: find out at which port the app is listening. The code you need will be something like server.listen(1234)
, where 1234 is the port.
第1步:找出应用正在侦听的端口。您需要的代码将类似于server.listen(1234),其中1234是端口。
Step 2: find out your server's ip address. If you used ssh to connect to the server, use that ip or hostname. Eg. ssh root@hostname
.
第2步:找出服务器的IP地址。如果您使用ssh连接到服务器,请使用该ip或主机名。例如。 ssh root @ hostname。
Step 3: in your browser navigate to [hostname or ip]:[port]
第3步:在浏览器中导航到[hostname或ip]:[port]
There could be other issues (express not handling the /
route, firewall), but these are the basics.
可能还有其他问题(表示不处理/ route,防火墙),但这些是基础知识。
#1
0
Step 1: find out at which port the app is listening. The code you need will be something like server.listen(1234)
, where 1234 is the port.
第1步:找出应用正在侦听的端口。您需要的代码将类似于server.listen(1234),其中1234是端口。
Step 2: find out your server's ip address. If you used ssh to connect to the server, use that ip or hostname. Eg. ssh root@hostname
.
第2步:找出服务器的IP地址。如果您使用ssh连接到服务器,请使用该ip或主机名。例如。 ssh root @ hostname。
Step 3: in your browser navigate to [hostname or ip]:[port]
第3步:在浏览器中导航到[hostname或ip]:[port]
There could be other issues (express not handling the /
route, firewall), but these are the basics.
可能还有其他问题(表示不处理/ route,防火墙),但这些是基础知识。