Cannot create property 'render' on string 'index'
Closed this issue · 2 comments
wszgxa commented
router.get('/', async (ctx, next) => {
let userName = 'test'
console.log(ctx.render)
await ctx.render('index', {
name: userName,
title: 'test'
})
})
wszgxa commented
oh,I should app.use...
strawbrary commented
It should work with router.get
and your code looks right. Is your Koa Nunjucks middleware configured like this?