fix typo (#756)
This commit is contained in:
parent
d47d0f9619
commit
2c507d335d
1 changed files with 3 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue