Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个与 Node.JS 应用程序通信的 Ruby 应用程序,我想知道是否有办法在我的 Ruby 应用程序中获取 Node 应用程序使用的端口。
如果没有,您可以强制在选定的端口上运行,而不更改节点应用程序中的代码吗?
我找到了这个,但它在 JS 中。
干杯!
编辑:这可以通过 -p port
您可以使用环境变量为应用程序提供端口号。或将其作为命令行参数提供。