title: Split Koa router and controller in multiple files
body: <p>I'm trying to split my application.
  Unfortunately it does not work to call the controller. As soon as I comment out the controller and the post method it works to call the server.</p>
  
  <p><strong>route/image.ts</strong></p>
  
  <pre><code>const imageController = require('../controllers/imageController.ts')
  
  module.exports = ({ router }) =&gt; {
    router
      .get('/image', ctx =&gt; {
        ctx.body = 'Image'
      })
      .post('/image', imageController.newImage)
  }
  </code></pre>
  
  <p><strong>controller/imageController.ts</strong></p>
  
  <pre><code>import { BaseContext } from 'koa'
  
  export default class imageController {
    static newImage = (ctx: BaseContext) =&gt; {
      // return OK status code
      ctx.status = 200
      ctx.body = 'Test'
    }
  }
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Unexpected token {                                                                                                                                                                                                                                        11:44:42
  
    (function (exports, require, module, __filename, __dirname) { import { BaseContext } from 'koa'
    ^
  
    SyntaxError: Unexpected token {
    at new Script (vm.js:84:7)
    at createScript (vm.js:264:10)
    at Object.runInThisContext (vm.js:312:10)
    at Module._compile (internal/modules/cjs/loader.js:684:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:22:18)
  </code></pre>