Use morgan to log requests in the dev server

This is motivated by the recent switch to Express 4.
Without this commit, “make serve” will print the following message:

Error: Most middleware (like logger) is no longer bundled
with Express and must be installed separately.  Please see
https://github.com/senchalabs/connect#middleware.
This commit is contained in:
Martin von Gagern 2017-01-12 09:52:29 +01:00
parent 4ead46c4ab
commit 79d53bd29f
2 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,7 @@
"js-yaml": "^3.3.1",
"jspngopt": "^0.2.0",
"less": "~2.7.1",
"morgan": "^1.7.0",
"nomnom": "^1.8.1",
"pako": "1.0.4",
"selenium-webdriver": "^2.48.2",

View File

@ -10,7 +10,8 @@ var less = require("less");
var app = express();
if (require.main === module) {
app.use(express.logger());
app.use(require("morgan")(
":date[iso] :method :url HTTP/:http-version - :status"));
}
var serveBrowserified = function(file, standaloneName) {