title: exporting the port as a variable from one file to use it in another in node js
body: <p>I am trying to create a chat application using socket.io using Express. In "bin/www" file I have define the port to be used.I have export the variable "port". The code goes as:  </p>
  
  <pre><code>var port = normalizePort(process.env.PORT || '3000');
  app.set('port', port);
  module.exports.port = port;
  </code></pre>
  
  <p>In another file "app.js" I want to use the same variable "port". so I imported the external file.While consoling its showing as variable "port" not defined :</p>
  
  <pre><code>var serverfile= require('./bin/www');
  console.log(serverfile.port);
  </code></pre>
  
  <p>Is the way of exporting the variable wrong?</p>