strawbrary/koa-nunjucks-2

Cannot create property 'render' on string 'index'

Closed this issue · 2 comments

router.get('/', async (ctx, next) => {
  let userName = 'test'
  console.log(ctx.render)
  await ctx.render('index', {
    name: userName,
    title: 'test'
  })
})

oh,I should app.use...

It should work with router.get and your code looks right. Is your Koa Nunjucks middleware configured like this?