Merge pull request #56 from jondavidjohn/heroku-start

"Deploy to Heroku" Button
This commit is contained in:
Michelle Bu 2014-11-01 13:01:20 -07:00
commit abb2d09c84
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) ##[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)** **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 ### 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.on('MethodNotAllowed', unknownMethodHandler);
this._app.get(this._options.path, function(req, res, next) {
res.send(require('../app.json'));
});
// Retrieve guaranteed random ID. // Retrieve guaranteed random ID.
this._app.get(this._options.path + ':key/id', function(req, res, next) { this._app.get(this._options.path + ':key/id', function(req, res, next) {
res.contentType = 'text/html'; res.contentType = 'text/html';

View File

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