npm.io
1.0.0 • Published 8 years ago

@libshin/koa-logger

Licence
MIT
Version
1.0.0
Deps
1
Size
1 kB
Vulns
0
Weekly
0

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);