morgan: added logging

This commit is contained in:
@wwwjim 2020-10-07 17:51:49 -07:00
parent a61723d81c
commit 85e999a20b
2 changed files with 5 additions and 0 deletions

View File

@ -67,6 +67,7 @@
"knex": "^0.21.5",
"minisearch": "^2.5.1",
"moment": "^2.27.0",
"morgan": "^1.10.0",
"next": "^9.5.2",
"pg": "^8.3.3",
"prismjs": "^1.20.0",

View File

@ -11,6 +11,7 @@ import express from "express";
import next from "next";
import compression from "compression";
import cors from "cors";
import morgan from "morgan";
const app = next({
dev: !Environment.IS_PRODUCTION,
@ -30,6 +31,9 @@ app.prepare().then(async () => {
const server = express();
server.use(cors());
server.use(
morgan(":method :url :status :res[content-length] - :response-time ms")
);
if (Environment.IS_PRODUCTION) {
server.use(compression());