Why do I get error: this.EJS is not a function?
<p>I am trying to teach myself Koa &amp; some middleware such as koa-ejs. When I run the following code I get the 'not a function' error. I am trying to follow the example at the koa-ejs site.</p>

<pre><code>"use strict";

class app {
     constructor() {
          app.loadServer();
     }

     static loadServer() {
          const KOA = require('koa'),
               ROUTER = require('koa-route'),
               SERVE = require('koa-static'),
               FS = require('co-fs'),
               PATH = require('path'),
               EJS = require('koa-ejs'),
               APP = KOA();

          EJS(APP, {
               root: PATH.join(__dirname, 'views'),
               layout: 'layout',
               viewExt: 'html',
               cache: false,
               debug: true
          });

          // APP.use(SERVE(__dirname + '/public'));

          APP.use(ROUTER.get('/', function* () {
               this.type = 'text/html';
               this.status = 200;
               yield this.EJS('index');
               // this.body = yield FS.readFile('public/views/index.html');
          }));

          APP.listen(1338);
     }
}

module.exports = app;
</code></pre>