Open mathieug opened 8 years ago
Seems like, in theory, you could do this by having an options
object with the following shape, since the port is also specified in VCAP_APPLICATION
:
{
vcap: {
application: {
port: myPortNumber
}
}
}
Doesn't look like this would work today, as only env vars are checked, but ... the code could be changed to check that also.
Advantage of doing it that way is there are fewer options to set the port, which should make it easier to figure out what port to actually use. Disadvantage is that it's a bit of a mouthful to use - an explicit port
value in options
would be less wordy.
Is there still any interest in doing something here?
We should be able to set a default port if we don't want to use
ports
package. Why not inoptions
ofcfenv.getAppEnv(options)
?