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

@@ -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) {