Merge pull request #650 from julien-f/patch-1

Use new operator to create a Koa v2 app
Yiyu He 2016-01-23 21:51:29 +08:00
commit b9c1f7d069
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,9 @@ $ npm install koa
Koa v2 is currently in alpha. In this new version, the middleware function signature completely changes in favor of ES2015-2016 syntax:
```js
// Koa application is now a class and requires the new operator.
const app = new Koa()
// uses async arrow functions
app.use(async (ctx, next) => {
try {