I decided to split my routers by their purpose, so they look like this:

**routers/homeRouter.ts**

```
import * as Router from 'koa-router';

const router: Router = new Router();

router
    .get('/', async (ctx, next) => {
        ctx.body = 'hello world';
    });

export = router;

```

**routers/userRouter.ts**

```
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;

```

With this, my app.ts has to import each of the routers one by one like this:

**app.ts**

```
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);

```

But what I want is this:

**app.ts**

```
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);

```

I do not know how to export the routers to achieve this. Can anyone help?