logger for koa extend.
$ npm install @koex/logger
// See more in test
import logger from '@koex/logger';
import * as Koa from 'koa';
const app = new Koa();
app.use(logger());
app.use(async (ctx) => {
if (ctx.path === '/') {
ctx.body = 'hello, world';
} else if (ctx.path === '/json') {
ctx.body = {
name: 'name',
value: 'value',
};
}
});
app.listen(8000, '0.0.0.0', () => {
console.log('koa server start');
});