Koa Adapter
Never have to worry about Koa's middleware compatibility.
Koa-adapter enables you to use 1.0 middlewares in Koa 2.0+.
Installation
$ npm install koa-adapter
Example
You could choose one of the two methods.
Adapt individual middleware
const adapt = // koa-logger@1 only support koa@1const logger = const koa = const app = // use legacy middlewares with adapt(...)app // and new ones directlyapp
Koa::use
Modify Support old (generator) middleware and the new middleware syntax
const Adapter = Adapter const _Koa = // create a thin wrapper for Koa::useconst Koa = const app = // use Koa 1.0 middlewareapp // or use new syntaxapp // or use `async` function (Babel required)app
License
Copyright (c) 2015 Jingwei "John" Liu
Licensed under the MIT license.