From 808768a5977321e61f506f65d553679a93120daa Mon Sep 17 00:00:00 2001 From: Zack Tanner Date: Thu, 12 May 2016 23:27:18 -0700 Subject: [PATCH] copy tweaks (#731) --- Readme.md | 8 ++++---- docs/guide.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index 0a6b382..444966e 100644 --- a/Readme.md +++ b/Readme.md @@ -41,19 +41,19 @@ app.listen(3000); ## Middleware -Koa is an middleware framework, it can take 3 different kind function as middleware: +Koa is a middleware framework that can take 3 different kinds of functions as middleware: * common function * async function * generatorFunction -Here we write an logger middleware with different function. +Here is an example of logger middleware with each of the different functions: ### Common function ```js -// Middleware normally take two parameters (ctx, next), ctx is the context for one request, -// next is an function that is invoked to execute the downstream middleware. It returns a Promise with a then function for running code after completion. +// Middleware normally takes two parameters (ctx, next), ctx is the context for one request, +// next is a function that is invoked to execute the downstream middleware. It returns a Promise with a then function for running code after completion. app.use((ctx, next) => { const start = new Date(); diff --git a/docs/guide.md b/docs/guide.md index b432951..eaa020d 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -1,7 +1,7 @@ # Guide - This guide covers Koa topics that are not directly API related, such as best practices for writing middleware, application structure suggestions, here we use async function as middleware you can also use commonFunction or generatorFunction which will be a little different. + This guide covers Koa topics that are not directly API related, such as best practices for writing middleware and application structure suggestions. In these examples we use async functions as middleware - you can also use commonFunction or generatorFunction which will be a little different. ## Writing Middleware