Code files

This commit is contained in:
Akhil
2017-07-31 11:33:31 +05:30
parent 073a63ebdd
commit b9ae409ec0
801 changed files with 17535 additions and 0 deletions
@@ -0,0 +1,19 @@
'use strict'
const router = require('koa-router')()
router.get('/', async function (ctx, next) {
await next()
ctx.log.info(`rendering index view with ${ctx.state.title}`)
await ctx.render('index')
}, async (ctx) => ctx.state = {title: 'Koa'})
// simplified:
// router.get('/', async (ctx, next) => {
// . ctx.log.info(`rendering index view with ${ctx.state.title}`)
// await ctx.render('index', {title: 'Koa'})
// })
module.exports = router