From 3eafcdd85a0e2d5453c8ec07ddcde2fd25e490cf Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Wed, 28 Aug 2013 21:05:35 -0700 Subject: [PATCH] add names to simple example middleware --- examples/simple.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/simple.js b/examples/simple.js index 4829f1f..e45cc17 100644 --- a/examples/simple.js +++ b/examples/simple.js @@ -6,7 +6,7 @@ var app = koa(); // x-response-time app.use(function(next){ - return function *(){ + return function *responseTime(){ var start = new Date; yield next; var ms = new Date - start; @@ -17,7 +17,7 @@ app.use(function(next){ // logger app.use(function(next){ - return function *(){ + return function *logger(){ var start = new Date; yield next; var ms = new Date - start; @@ -28,7 +28,7 @@ app.use(function(next){ // content-length app.use(function(next){ - return function *(){ + return function *contentLength(){ yield next; if (!this.body) return; this.set('Content-Length', Buffer.byteLength(this.body)); @@ -38,7 +38,7 @@ app.use(function(next){ // custom 404 handler app.use(function(next){ - return function *(){ + return function *notfound(){ yield next; if (this.body) return; this.status = 404; @@ -49,7 +49,7 @@ app.use(function(next){ // response app.use(function(next){ - return function *(){ + return function *response(){ yield next; if ('/' != this.url) return; this.body = 'Hello World';