This commit is contained in:
qingming 2016-06-22 11:01:51 +08:00 committed by jongleberry
parent d47d0f9619
commit 2c507d335d

View file

@ -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();