Skip to content

koexjs/logger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logger

NPM version Coverage Status Dependencies Build Status license issues

logger for koa extend.

Install

$ npm install @koex/logger

Usage

// 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');
});

Related

Packages

No packages published

Languages

  • TypeScript 100.0%