Saturday 20 May 2017

Nodejs Koa2: TyperError: ctx.render is not a function

I am pretty new to Node and Koa2, so please bear with me.

I am getting this error:

TypeError: ctx.render is not a function

This is the line where the error gets triggered:

class HtmlRouter {
    static async home(ctx) {
        await ctx.render('index.ejs', {});
    }
}

I am using ejs as the templating engine.

What am I doind wrong or missing?



via Xar

No comments:

Post a Comment