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:
parent
4ead46c4ab
commit
79d53bd29f
|
@ -25,6 +25,7 @@
|
||||||
"js-yaml": "^3.3.1",
|
"js-yaml": "^3.3.1",
|
||||||
"jspngopt": "^0.2.0",
|
"jspngopt": "^0.2.0",
|
||||||
"less": "~2.7.1",
|
"less": "~2.7.1",
|
||||||
|
"morgan": "^1.7.0",
|
||||||
"nomnom": "^1.8.1",
|
"nomnom": "^1.8.1",
|
||||||
"pako": "1.0.4",
|
"pako": "1.0.4",
|
||||||
"selenium-webdriver": "^2.48.2",
|
"selenium-webdriver": "^2.48.2",
|
||||||
|
|
|
@ -10,7 +10,8 @@ var less = require("less");
|
||||||
var app = express();
|
var app = express();
|
||||||
|
|
||||||
if (require.main === module) {
|
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) {
|
var serveBrowserified = function(file, standaloneName) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user