title: How to combine separated Koa-Routers with Typescript
body: <p>I decided to split my routers by their purpose, so they look like this:</p>
  
  <p><strong>routers/homeRouter.ts</strong></p>
  
  <pre><code>import * as Router from 'koa-router';
  
  const router: Router = new Router();
  
  router
      .get('/', async (ctx, next) =&gt; {
          ctx.body = 'hello world';
      });
  
  export = router;
  </code></pre>
  
  <p><strong>routers/userRouter.ts</strong></p>
  
  <pre><code>import * as Router from 'koa-router';
  import UserController = require('../controller/userController');
  
  const router: Router = new Router(
      {
          prefix: 'users'
      }
  );
  
  var userController = new UserController();
  
  router
      .post('/user/:email/:password', userController.signUp);
  
  export = router;
  </code></pre>
  
  <p>With this, my app.ts has to import each of the routers one by one like this:</p>
  
  <p><strong>app.ts</strong></p>
  
  <pre><code>import * as Koa from 'koa';
  import * as homeRouter from './routers/homeRouter';
  import * as userRouter from './routers/userRouter';
  const app: Koa = new Koa();
  app
      .use(homeRouter.routes())
      .use(homeRouter.allowedMethods());
  app
      .use(userRouter.routes())
      .use(userRouter.allowedMethods());
  app.listen(3000);
  </code></pre>
  
  <p>But what I want is this:</p>
  
  <p><strong>app.ts</strong></p>
  
  <pre><code>import * as Koa from 'koa';
  import * as routers from './routers';
  const app: Koa = new Koa();
  app
      .use(routers.routes())
      .use(routers.allowedMethods());
  app.listen(3000);
  </code></pre>
  
  <p>I do not know how to export the routers to achieve this. Can anyone help?</p>