title: How can I split my koa routes into separate files?
body: <p>I'm trying to figure out how to split my routes into separate files.</p>
  
  <p>I have this so far, but it doesn't work. I just get <code>Not found</code> when I try to access <code>http://localhost:3001/api/things</code></p>
  
  <pre><code>//server.js
  var koa = require('koa');
  var app = koa();
  var router = require('koa-router');
  
  app.use(router(app));
  require('./routes')(app);
  
  
  // routes.js
  module.exports = function *(app){
    app.use('/api/things', require('./api/things'));
  };
  
  
  // api/things/index.js
  
  var Router = require('koa-router');
  var router = new Router({
    prefix: '/api/things'
  });
  
  router.get('/', function *(){
    this.body = [{ name: 'Foo'}, { name: 'Bar' }];
  });
  
  module.exports = router;
  </code></pre>