From 2c507d335d1125eaf9fd6770519e9e2be47c5961 Mon Sep 17 00:00:00 2001 From: qingming <358242939@qq.com> Date: Wed, 22 Jun 2016 11:01:51 +0800 Subject: [PATCH] fix typo (#756) --- docs/guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/guide.md b/docs/guide.md index eaa020d..c2ee87b 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -114,7 +114,7 @@ function logger(format) { const compose = require('koa-compose'); async function random(ctx, next) { - if ('/random' == this.path) { + if ('/random' == ctx.path) { ctx.body = Math.floor(Math.random() * 10); } else { await next(); @@ -122,7 +122,7 @@ async function random(ctx, next) { }; async function backwards(ctx, next) { - if ('/backwards' == this.path) { + if ('/backwards' == ctx.path) { ctx.body = 'sdrawkcab'; } else { await next(); @@ -130,7 +130,7 @@ async function backwards(ctx, next) { } async function pi(ctx, next) { - if ('/pi' == this.path) { + if ('/pi' == ctx.path) { ctx.body = String(Math.PI); } else { await next();