The process.env.port number appears to be randomly generated with each run from Visual Studio (with F5 or Ctrl+F5). Going into the properties window for the project and setting a "Node.js port" gives me a fixed port number. Perhaps the random port could be assigned by default when creating a new project so it doesn't change with each run. Quite often I want to refresh an existing browser window when I re-launch the server, which doesn't work if the port is changing by default.
↧