koa-add-to-context
v1.0.0
Published
Koa middleware to add all enumerable keys to the context of each request
Downloads
18
Readme
koa-add-to-context
Koa middleware to add all enumerable keys to the context of each request
Installation
$ npm i koa-add-to-context
Usage
var addToContext = require('koa-add-to-context')
var koa = require('koa')
var app = koa()
app.use(addToContext({ foo: 'foo' }))
app.use(function * () {
this.body = this.foo
})
API
addToContext(obj: Object): GeneratorFunction
Test
npm test
License
MIT