add use of koa-logger

This commit is contained in:
Jakub Sokołowski 2018-12-13 21:53:32 +01:00
parent 23dae43143
commit e9d2072e8f
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import Koa from 'koa'
import JSON from 'koa-json'
import Logger from 'koa-logger'
import JsonError from 'koa-json-error'
import JoiRouter from 'koa-joi-router'
import BodyParser from 'koa-bodyparser'
@ -8,7 +9,8 @@ const App = (ghc) => {
const app = new Koa()
const router = new JoiRouter()
app.use(JSON({pretty: true}))
app.use(Logger())
.use(JSON({pretty: true}))
.use(JsonError())
.use(router.middleware())
.use(BodyParser({onerror:console.error}))