Browse Source

common-log-format dep no longer directly required

master
Lloyd Brookes 10 years ago
parent
commit
57672fd114
  1. 10
      bin/ws.js
  2. 1
      package.json

10
bin/ws.js

@ -14,7 +14,6 @@ var dope = require("console-dope"),
compress = require("compression"),
homePath = require("home-path"),
byteSize = require("byte-size"),
clf = require("common-log-format"),
logStats = require("stream-log-stats");
var usage =
@ -91,10 +90,11 @@ if (argv.config){
}
app.use(morgan(argv["log-format"]));
/* if no specific `--log-format` required, pipe the default web log output
into `log-stats`, which prints statistics to the console */
} else {
var statStream = clf();
statStream.pipe(logStats());
app.use(morgan({ stream: statStream }));
app.use(morgan({ stream: logStats() }));
}
/* --compress enables compression */
@ -115,7 +115,7 @@ if (argv.config){
})
.listen(argv.port);
/* write status to stderr so stdout can be piped to disk ($ ws > log.txt) */
/* write status to stderr (stdout is reserved for web log output) */
if (path.resolve(argv.directory) === process.cwd()){
dope.error("serving at %underline{%s}", "http://localhost:" + argv.port);
} else {

1
package.json

@ -16,7 +16,6 @@
"dependencies": {
"byte-size": "^0.1.0",
"command-line-args": "^0.2.0",
"common-log-format": "^0.1.2",
"compression": "^1.0.2",
"config-master": "~0.2.0",
"connect": "^3.0.0",

Loading…
Cancel
Save