From 71b24b05d0db8f7adeeac0012bb65a4517fb5276 Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Tue, 4 Sep 2018 12:09:03 -0700 Subject: [PATCH] added http logging to the console in dev --- package-lock.json | 30 ++++++++++++++++++++++++++++++ package.json | 1 + server/bin/dev.js | 2 ++ 3 files changed, 33 insertions(+) diff --git a/package-lock.json b/package-lock.json index db732c80..8c879059 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1845,6 +1845,23 @@ "integrity": "sha512-LIVmqIrIWuiqTvn4RzcrwCOuHo2DD6tKmKBPXXlr4p4n4l6BZBkwFTIa3zu1XkX5MbZgro4a6BvPi+n2Mns5Gg==", "dev": true }, + "basic-auth": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz", + "integrity": "sha1-AV2z81PgLlY3d1X5YnQuiYHnu7o=", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + } + } + }, "batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", @@ -8205,6 +8222,19 @@ "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" }, + "morgan": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz", + "integrity": "sha1-0B+mxlhZt2/PMbPLU6OCGjEdgFE=", + "dev": true, + "requires": { + "basic-auth": "~2.0.0", + "debug": "2.6.9", + "depd": "~1.1.1", + "on-finished": "~2.3.0", + "on-headers": "~1.0.1" + } + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", diff --git a/package.json b/package.json index e67c9135..78fa8eaa 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,7 @@ "husky": "^0.14.3", "lint-staged": "^7.2.0", "mocha": "^5.2.0", + "morgan": "^1.9.0", "nanobus": "^4.3.2", "nanotiming": "^7.3.1", "node-jose": "^1.0.0", diff --git a/server/bin/dev.js b/server/bin/dev.js index 329f3c0c..7610cb21 100644 --- a/server/bin/dev.js +++ b/server/bin/dev.js @@ -5,6 +5,7 @@ const pages = require('../routes/pages'); const tests = require('../../test/frontend/routes'); const express = require('express'); const expressWs = require('express-ws'); +const morgan = require('morgan'); const config = require('../config'); module.exports = function(app, devServer) { @@ -15,6 +16,7 @@ module.exports = function(app, devServer) { assets.setMiddleware(devServer.middleware); locales.setMiddleware(devServer.middleware); + app.use(morgan('dev', { stream: process.stderr })); routes(app); tests(app); // webpack-dev-server routes haven't been added yet