title: Node.js MVC Routing Issue
body: <p>I'm implementing an MVC pattern in Node.js and I have it setup as described below. I'm getting a page on localhost which is just hanging and '/' in my console.log as I have a logger.</p>
  
  <p>app.js</p>
  
  <pre><code>var express  = require("express");
  var partials = require("express-partials");
  var cookies  = require("cookie-parser");
  var session  = require("express-session");
  var uuid     = require("node-uuid");
  var parser   = require("body-parser");
  var csrf     = require("csurf");
  var compress = require("express-html-minify");
  
  var logger   = require("./controllers/logger");
  var errors   = require("./controllers/errors");
  var utility  = require("./controllers/utility");
  
  var routes   = require("./routes");
  
  var app  = new express();
  var port = 80;
  
  app.set("view engine", "ejs");
  app.set("views", __dirname + "/views");
  app.set("view options", {defaultLayout: "layout"});
  
  app.use(express.static(__dirname + "/public"));
  
  app.use(logger.log);
  app.use(partials());
  app.use(cookies());
  app.use(session({secret: uuid.v1(), resave: true, saveUninitialized: true}));
  app.use(parser.json());
  app.use(parser.urlencoded({extended: false}));
  app.use(csrf());
  app.use(utility.csrf);
  app.use(compress);
  app.use(routes.controller);
  
  app.use(errors.error);
  app.use(errors.notfound);
  
  app.listen(port);
  console.log("app listening on port " + port);
  </code></pre>
  
  <p>./routes/index.js</p>
  
  <pre><code>var express = require("express");
  
  var app = express();
  
  var controllers = require("../controllers");
  
  exports.controller = function() {
      app.get("/", controllers.index);
      app.get("/login", controllers.login);
      app.post("/login", controllers.process);
      app.get("/reset", controllers.reset);
      app.get("/whoops", controllers.whoops);
  };
  </code></pre>
  
  <p>./controllers/index.js</p>
  
  <pre><code>exports.index = function(request, response) {
      response.render("index", {layout: "layout", title: "Index", cookie: JSON.stringify(request.cookies), session: JSON.stringify(request.session)});
  };
  
  exports.login = function(request, response) {
      response.render("login", {layout: "layout", title: "Login", cookie: JSON.stringify(request.cookies), session: JSON.stringify(request.session)});
  };
  
  exports.process = function(request, response) {
      response.render("process", {layout: "layout", title: "Process", username: request.body.username});
  };
  
  exports.reset = function(request, response) {
      response.render("reset", {layout: "layout", title: "Reset"});
  };
  
  exports.whoops = function(request, response) {
      response.render("whoops", {layout: "layout", title: "Whoops"});
  };
  </code></pre>