make logger great again

This commit is contained in:
syuilo 2018-04-19 18:03:46 +09:00
parent d908e9a965
commit ed2aa9c9b1
2 changed files with 9 additions and 0 deletions

View file

@ -56,6 +56,7 @@
"@types/koa-bodyparser": "4.2.0",
"@types/koa-compress": "^2.0.8",
"@types/koa-favicon": "2.0.19",
"@types/koa-logger": "^3.1.0",
"@types/koa-mount": "3.0.1",
"@types/koa-multer": "1.0.0",
"@types/koa-router": "7.0.27",
@ -141,6 +142,7 @@
"koa-compress": "3.0.0",
"koa-favicon": "2.0.1",
"koa-json-body": "^5.3.0",
"koa-logger": "^3.2.0",
"koa-mount": "3.0.0",
"koa-multer": "1.0.2",
"koa-router": "7.4.0",

View file

@ -10,6 +10,7 @@ import * as Koa from 'koa';
import * as Router from 'koa-router';
import * as mount from 'koa-mount';
import * as compress from 'koa-compress';
import * as logger from 'koa-logger';
import activityPub from './activitypub';
import webFinger from './webfinger';
@ -19,6 +20,12 @@ import config from '../config';
const app = new Koa();
app.proxy = true;
if (process.env.NODE_ENV != 'production') {
// Logger
app.use(logger());
}
// Compress response
app.use(compress({
flush: zlib.constants.Z_SYNC_FLUSH
}));