Miss any of our Open RFC calls?Watch the recordings here! »

@libshin/koa-logger

1.0.0 • Public • Published

TL;DR

Logger for koa

Installation

npm

$ npm i --save @libshin/koa-logger

yarn

$ yarn add @libshin/koa-logger

How to use

const Koa = require("koa");
const logger = require("@libshin/koa-logger");
 
const app = new Koa();
 
if (process.env.NODE_ENV !== "production") {
  app.use(logger);
}
 
app.use(async ctx => {
  ctx.body = "Hello World";
});
 
const DEFAULT_PORT = 3000;
const PORT = process.env.PORT || DEFAULT_PORT;
 
app.listen(PORT);

Keywords

none

Install

npm i @libshin/koa-logger

DownloadsWeekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

1.37 kB

Total Files

4

Last publish

Collaborators

  • avatar
  • avatar