Browse Source

docs

master
Lloyd Brookes 11 years ago
parent
commit
4087cf6601
  1. 5
      README.md
  2. 3
      bin/ws.js
  3. 2
      lib/cli-options.js

5
README.md

@ -27,8 +27,9 @@ $ ws --help
Server Server
-p, --port <number> Web server port -p, --port <number> Web server port
-f, --log-format <string> Access log format, written to stdout. Use one of
'none', 'dev', 'default', 'short', 'tiny' or 'logstalgia'
-f, --log-format <string> If a format is supplied an access log is written to stdout. If not,
a statistics view is displayed. Format options: 'none', 'dev',
'default', 'short', 'tiny' or 'logstalgia'.
-d, --directory <string> Root directory, defaults to the current directory -d, --directory <string> Root directory, defaults to the current directory
-c, --compress Enables compression -c, --compress Enables compression
-r, --refreshRate <number> Statistics view refresh rate in ms. Defaults to 500. -r, --refreshRate <number> Statistics view refresh rate in ms. Defaults to 500.

3
bin/ws.js

@ -15,6 +15,7 @@ var dope = require("console-dope"),
compress = require("compression"), compress = require("compression"),
cliOptions = require("../lib/cli-options"); cliOptions = require("../lib/cli-options");
/* specify the command line arg definitions and usage forms */
var cli = cliArgs(cliOptions); var cli = cliArgs(cliOptions);
var usage = cli.usage({ var usage = cli.usage({
forms: [ forms: [
@ -96,7 +97,7 @@ if (argv.Misc.config){
/* --compress enables compression */ /* --compress enables compression */
if (argv.Server.compress) app.use(compress()); if (argv.Server.compress) app.use(compress());
/* static file server including directory browsing support */
/* enable static file server, including directory browsing support */
app.use(serveStatic(path.resolve(argv.Server.directory))) app.use(serveStatic(path.resolve(argv.Server.directory)))
.use(directory(path.resolve(argv.Server.directory), { icons: true })); .use(directory(path.resolve(argv.Server.directory), { icons: true }));

2
lib/cli-options.js

@ -8,7 +8,7 @@ module.exports = [
}, },
{ {
name: "log-format", alias: "f", type: String, name: "log-format", alias: "f", type: String,
description: "Access log format, written to stdout. Use one of \n'none', 'dev', 'default', 'short', 'tiny' or 'logstalgia'"
description: "If a format is supplied an access log is written to stdout. If not, \na statistics view is displayed. Format options: 'none', 'dev',\n'default', 'short', 'tiny' or 'logstalgia'."
}, },
{ {
name: "directory", alias: "d", type: String, name: "directory", alias: "d", type: String,

Loading…
Cancel
Save