From b3b00d9ebe80c80c54e47e52cae7acaf1e34e5f9 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Sat, 23 Jan 2016 14:31:05 +0100 Subject: [PATCH] Use new operator to create a Koa v2 app Without it one would get: `TypeError: Class constructors cannot be invoked without 'new'`. --- Readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Readme.md b/Readme.md index 350a7b2..0fbf3fd 100644 --- a/Readme.md +++ b/Readme.md @@ -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 {