title: Express module error while listening http server in nodejs
body: <p>I have created a nodejs http server</p>
  
  <pre><code>var http = require("http");
  var url = require("url");
  var express = require('express');
  var app = express();
  
  function start(route, handle){
      function onRequest(request,response){
          var pathname = url.parse(request.url).pathname;
          console.log("Request for " + pathname + " received.");
          route(handle, pathname, response, request);
      }
  
      http.createServer(onRequest).listen(8888);
      console.log("Server has started");
      app.listen(8888);
      console.log('Express app listening on port 8888');
  }
  </code></pre>
  
  <p>it gives error</p>
  
  <pre><code>f:\Labs\nodejs\webapp&gt;node index.js
  Server has started
  Express app listening on port 8888
  
  events.js:66
          throw arguments[1]; // Unhandled 'error' event
                         ^
  Error: listen EADDRINUSE
      at errnoException (net.js:769:11)
      at Server._listen2 (net.js:909:14)
      at listen (net.js:936:10)
      at Server.listen (net.js:985:5)
      at Function.app.listen (f:\Labs\nodejs\webapp\node_modules\express\lib\appli
  cation.js:532:24)
      at Object.start (f:\Labs\nodejs\webapp\server.js:15:6)
      at Object.&lt;anonymous&gt; (f:\Labs\nodejs\webapp\index.js:11:8)
      at Module._compile (module.js:449:26)
      at Object.Module._extensions..js (module.js:467:10)
      at Module.load (module.js:356:32)
  </code></pre>
  
  <p>when i change the port of app.listen it dont throw this error, what can be done?</p>
  
  <p>will changing port other than server port will keep the session of the server on another port??</p>
  
  <p>and how can i access this app variable in other js page to get/set the data?</p>