[Koa] custom properties

example:
```
const config = require('./config')
const app = new Koa();
app.context.config = config;

app.use((ctx, next) => {
    // use `config` object
    const config = ctx.config
})
```
This commit is contained in:
Ivan Lyons
2018-11-06 14:49:09 +08:00
committed by GitHub
parent 7500ae4609
commit 4fa9fd98dc

View File

@@ -694,6 +694,7 @@ declare namespace Application {
* To bypass Koa's built-in response handling, you may explicitly set `ctx.respond = false;`
*/
respond?: boolean;
[key: string]: any;
}
}