Update README and script to accept path

This commit is contained in:
Michelle Bu 2014-03-01 12:37:46 -08:00
parent 4fc23261b3
commit 2983739725
2 changed files with 8 additions and 4 deletions

View File

@ -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
<script>
// No API key required when not using cloud server
var peer = new Peer('someid', {host: 'localhost', port: 9000});
var peer = new Peer('someid', {host: 'localhost', port: 9000, path: '/myapp'});
</script>
```

View File

@ -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
);