From 2983739725fa4a95a44a584f258bb1fecbf01d72 Mon Sep 17 00:00:00 2001 From: Michelle Bu Date: Sat, 1 Mar 2014 12:37:46 -0800 Subject: [PATCH] Update README and script to accept path --- README.md | 4 ++-- bin/peerjs | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bc46a4b..a0c03da 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Or, create a custom server: ```javascript var PeerServer = require('peer').PeerServer; -var server = new PeerServer({ port: 9000 }); +var server = new PeerServer({port: 9000, path: '/myapp'}); ``` Connecting to the server from PeerJS: @@ -36,7 +36,7 @@ Connecting to the server from PeerJS: ```html ``` diff --git a/bin/peerjs b/bin/peerjs index 83ba95a..2e3f3bb 100755 --- a/bin/peerjs +++ b/bin/peerjs @@ -49,7 +49,11 @@ var path = require('path') port: { demand: true, alias: 'p', - description: 'port', + description: 'port' + }, + path: { + demand: false, + description: 'custom path' } }).argv; @@ -67,5 +71,5 @@ process.on('uncaughtException', function(e) { var server = new PeerServer(opts); console.log( - "Started PeerServer, port: " + opts.port + (" (v. %s)"), version + 'Started PeerServer, port: ' + opts.port + ', path: ' + (opts.path || '/') + (" (v. %s)"), version );