Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update docs and command line options

  • Loading branch information...
commit a84c86fc7324c370f06703fb23cc508a5d1f929a 1 parent ac0955f
@dchester dchester authored
Showing with 77 additions and 24 deletions.
  1. +26 −2 README.md
  2. +51 −22 bin/lilbro
View
28 README.md
@@ -45,12 +45,36 @@ lilBro.write({event_type: 'page_load'});
## Server
-First set up [devent-router](https://github.com/shutterstock/devent-router) and [devent-forwarder](https://github.com/shutterstock/devent-forwarder). Then start up the listener:
+Start up the node listener and write events to a log file:
```
-$ bin/lilbro --devent-host mydeventforwarder
+$ bin/lilbro --output-file lilb.log
```
+#### Usage Options
+
+```
+Usage: node lilbro [options]
+
+Options:
+ --png-bug FILE path to the image file to return to clients
+ --https-port PORT port to listen for https connections
+ --https-key FILE path to the file containing the private key
+ --https-cert FILE path to the file containing the secure certificate
+ --http-port PORT port to listen on
+ --devent-host HOST devent hostname
+ --devent-port PORT devent port
+ --devent-topic STRING devent topic to write events to when writing to devent
+ --client-js-path DIR path to find client library sources
+ --writer [file|devent-zmq|devent-forwarder] method to use for writing events
+ --output-file FILE path to log to when writing events to file
+
+```
+
+#### Devent
+
+To write to Devent, use `--writer devent-zmq` or '--writer devent-forwarder`. See [devent-router](https://github.com/shutterstock/devent-router) and [devent-forwarder](https://github.com/shutterstock/devent-forwarder).
+
## Authors
This library was developed by Douglas Hunter, Dave Kozma and Eric Smiling at [Shutterstock](http://www.shutterstock.com)
View
73 bin/lilbro
@@ -1,53 +1,82 @@
#!/usr/bin/env node
+var fs = require('fs');
+
var lilbro = require('../lib/lilbro')
, nomnom = require('nomnom');
+var writerFiles = fs.readdirSync(__dirname + '/../lib/writers');
+var writers = writerFiles.map( function(f) { return f.replace(/\.js$/, '') });
+
var opts = nomnom.opts({
'png-bug': {
- string: '--png-bug',
- default: './data/b.png'
+ full: 'png-bug',
+ default: './data/b.png',
+ help: 'path to the image file to return to clients',
+ metavar: 'FILE'
},
'https-port': {
- string: '--https-port',
- default: false
+ full: 'https-port',
+ default: false,
+ help: 'port to listen for https connections',
+ metavar: 'PORT'
},
'https-key': {
- string: '--https-key',
- default: './data/test-cert/privatekey.pem'
+ full: 'https-key',
+ default: './data/test-cert/privatekey.pem',
+ help: 'path to the file containing the private key',
+ metavar: 'FILE'
},
'https-cert': {
- string: '--https-cert',
- default: './data/test-cert/certificate.pem'
+ full: 'https-cert',
+ default: './data/test-cert/certificate.pem',
+ help: 'path to the file containing the secure certificate',
+ metavar: 'FILE'
},
'http-port': {
- string: '--http-port',
- default: 8000
+ full: 'http-port',
+ default: 8000,
+ help: 'port to listen on',
+ metavar: 'PORT'
},
'devent-host': {
- string: '--devent-host',
- default: '127.0.0.1'
+ full: 'devent-host',
+ default: '127.0.0.1',
+ help: 'devent hostname',
+ metavar: 'HOST'
},
'devent-port': {
- string: '--devent-port',
- default: 7664
+ full: 'devent-port',
+ default: 7664,
+ help: 'devent port',
+ metavar: 'PORT'
},
'devent-topic': {
- string: '--devent-topic',
- default: 'lilbro'
+ full: 'devent-topic',
+ default: 'lilbro',
+ help: 'devent topic to write events to when writing to devent',
+ metavar: 'STRING'
},
'client-js-path': {
- string: '--client-js-path',
- default: './client/src/'
+ full: 'client-js-path',
+ default: './client/src/',
+ help: 'path to find client library sources',
+ metavar: 'DIR'
},
'writer': {
- string: '--writer',
- default: 'file'
+ file: 'writer',
+ default: 'file',
+ metavar: '[' + writers.join('|') + ']',
+ choices: writers,
+ help: 'method to use for writing events'
},
'output-file': {
- string: '--output-file',
- default: undefined
+ full: 'output-file',
+ default: 'lilb.log',
+ help: 'path to log to when writing events to file',
+ metavar: 'FILE'
}
+
}).parseArgs();
lilbro.initialize(opts);
Please sign in to comment.
Something went wrong with that request. Please try again.