Node.JS: How to get the server's port from an external app?

I'm developing a Ruby app that communicate with Node.JS app and I want to know if there is a way to get the port used by the Node's app in my Ruby app.

If not, can you force to run on a choosen port, without changing the code in the Node's app ?

I have found this, but it is in JS.

Cheers !

EDIT: This is possible with -p port

You can use environment variable to provide the port number to application. Or give it as a command line parameter.