title: Can someone explain how i can use module.exports this way
body: <p>I am trying to understand what is going on when I use module.exports with a variable in a model view controller type project. I just do not understand what the book means by using it in this way</p>
  
  <pre><code>var express = require("./config/express.js");
  var app = express();
  
  app.listen(3000);
  module.exports = app; // my problem is right here what is it doing 
  
  console.log("Server running at http://localhost:3000/");
  </code></pre>
  
  <h2>    my config/ express file is also here</h2>
  
  <pre><code>var express = require("express");
  
  module.exports = function()
  {
    var app = express();
  
  
    require("../app/routes/index.server.routes.js")(app);
    return app;  
  }
  </code></pre>