JSPM

koa-connect

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 141828
  • Score
    100M100P100Q156028F
  • License MIT

Use connect and express middleware in koa

Package Exports

  • koa-connect

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (koa-connect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

koa-connect

Use connect and express middleware in koa

Install

npm install koa-connect

Usage:

var koa = require('koa');
var c2k = require('koa-connect');
var app = koa();

function middleware (req, res, next) {
  console.log('connect');
  next();
}

app.use(c2k(middleware));

app.use(function * () {
  this.body = 'koa';
});

app.listen(3000);

License

MIT