title: Why does my node.js express code not call console.log()?
body: <p>How come "homepage requested" never gets output to the terminal console when I run <code>server.js</code> and go to <code>localhost:8000</code>? <code>index.html</code> renders fine</p>
  
  <p><strong>server.js</strong></p>
  
  <pre><code>var express = require("express");
  var path = require('path');
  var index = require('./routes/index');
  
  var app = express();
  
  var port = 8000;
  app.set("views", path.join(__dirname, 'views'));
  app.set("view engine", "ejs");
  app.engine("html", require("ejs").renderFile);
  
  app.use(express.static(path.join(__dirname, 'client')));
  
  app.use('/', index);
  
  app.listen(port, function() {
    console.log("server started on port", port);
  });
  </code></pre>
  
  <p><strong>index.js</strong></p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  
  router.get('/', function(req, res, next) {
    console.log('homepage requested'); // never executes
    res.render('index.html');          // always executes
  });
  
  module.exports = router;
  </code></pre>