conform with new morgan API
This commit is contained in:
@ -18,7 +18,7 @@ var dope = require("console-dope"),
|
|||||||
|
|
||||||
/* specify the command line arg definitions and usage forms */
|
/* specify the command line arg definitions and usage forms */
|
||||||
var cli = cliArgs(cliOptions);
|
var cli = cliArgs(cliOptions);
|
||||||
var usage = cli.usage({
|
var usage = cli.getUsage({
|
||||||
forms: [
|
forms: [
|
||||||
"$ ws <server options>",
|
"$ ws <server options>",
|
||||||
"$ ws --config",
|
"$ ws --config",
|
||||||
@ -94,7 +94,7 @@ if (argv.Misc.config){
|
|||||||
return (a.getDate() + "/" + a.getUTCMonth() + "/" + a.getFullYear() + ":" + a.toTimeString())
|
return (a.getDate() + "/" + a.getUTCMonth() + "/" + a.getFullYear() + ":" + a.toTimeString())
|
||||||
.replace("GMT", "").replace(" (BST)", "");
|
.replace("GMT", "").replace(" (BST)", "");
|
||||||
});
|
});
|
||||||
logFormat = "default";
|
logFormat = "combined";
|
||||||
}
|
}
|
||||||
|
|
||||||
app.use(morgan(logFormat));
|
app.use(morgan(logFormat));
|
||||||
@ -104,7 +104,7 @@ if (argv.Misc.config){
|
|||||||
into `log-stats`, which prints statistics to the console */
|
into `log-stats`, which prints statistics to the console */
|
||||||
} else {
|
} else {
|
||||||
dope.hideCursor();
|
dope.hideCursor();
|
||||||
app.use(morgan({ stream: logStats({ refreshRate: argv.Server["refresh-rate"] }) }));
|
app.use(morgan("common", { stream: logStats({ refreshRate: argv.Server["refresh-rate"] }) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --compress enables compression */
|
/* --compress enables compression */
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"repository": "https://github.com/75lb/local-web-server",
|
"repository": "https://github.com/75lb/local-web-server",
|
||||||
"author": "Lloyd Brookes",
|
"author": "Lloyd Brookes",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"command-line-args": "^0.3.0",
|
"command-line-args": "^0.5.0",
|
||||||
"compression": "^1.0.2",
|
"compression": "^1.0.2",
|
||||||
"config-master": "~0.2.0",
|
"config-master": "~0.2.0",
|
||||||
"connect": "^3.0.0",
|
"connect": "^3.0.0",
|
||||||
|
Reference in New Issue
Block a user