Ver código fonte

enable "Deploy to Heroku" Button

Jonathan Johnson 10 anos atrás
pai
commit
bd101ab44f
4 arquivos alterados com 14 adições e 2 exclusões
  1. 3 1
      README.md
  2. 5 0
      app.json
  3. 4 0
      lib/server.js
  4. 2 1
      package.json

+ 3 - 1
README.md

@@ -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 - 0
app.json

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

+ 4 - 0
lib/server.js

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

+ 2 - 1
package.json

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