title: Express endpoint not getting called
body: <p>An endpoint works fine if added directly to my <code>server.js</code> file:</p>
  
  <pre><code>app.post('/test', function(req,res) {
    res.status(200).send({"message" : "OK"});
  });
  </code></pre>
  
  <p>but in an attempt to refactor the app I include a file called <code>api.js</code> from <code>server.js</code> like this:</p>
  
  <pre><code>var routesApi = require('./server/routes/api');
  app.use('/v1', routesApi);
  </code></pre>
  
  <p>and it looks like this:</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  
  module.exports = function() {   
    router.post('/test', function(req, res){
      res.status(200).send({"message" : "OK"});
    });
  
    return router;
  }
  </code></pre>
  
  <p>but if I try and hit this end point the req "stalls" as there is no response. What am I doing wrong?</p>