diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/index.js b/src/index.js index 9ba74de..630ac08 100644 --- a/src/index.js +++ b/src/index.js @@ -8,10 +8,12 @@ const app = new Koa() const Router = require('koa-router') const router = new Router() -router.get('/', function (ctx, next) { - ctx.status = 200 - ctx.body = 'hello world' - next() +const view = require('koa-nunjucks-next') + +app.use(view(`${__dirname}/views`)) + +router.get('/', async function (ctx, next) { + await ctx.render('index') }) app.use(router.routes()).use(router.allowedMethods()) |