enable "Deploy to Heroku" Button

This commit is contained in:
Jonathan Johnson 2014-10-23 08:42:12 -05:00
parent 5c9d1a0416
commit bd101ab44f
4 changed files with 14 additions and 2 deletions

View File

@ -6,9 +6,11 @@ PeerServer helps broker connections between PeerJS clients. Data is not proxied
##[http://peerjs.com](http://peerjs.com)
**If you prefer to use a cloud hosted PeerServer instead of running your own, [sign up for a free API key here](http://peerjs.com/peerserver)**
or
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)
### Run PeerServer

5
app.json Normal file
View File

@ -0,0 +1,5 @@
{
"name": "PeerJS Server",
"description": "A server side element to broker connections between PeerJS clients.",
"website": "http://peerjs.com/"
}

View File

@ -212,6 +212,10 @@ PeerServer.prototype._initializeHTTP = function() {
this._app.on('MethodNotAllowed', unknownMethodHandler);
this._app.get('/', function(req, res, next) {
res.send(require('../app.json'));
});
// Retrieve guaranteed random ID.
this._app.get(this._options.path + ':key/id', function(req, res, next) {
res.contentType = 'text/html';

View File

@ -26,6 +26,7 @@
"node": ">=0.8"
},
"scripts": {
"test": "mocha test"
"test": "mocha test",
"start": "bin/peerjs --port ${PORT:=9000}"
}
}