diff --git a/README.md b/README.md index c18a098c..e7a85bde 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ # chat-example -This is the source code for a very simple chat example used for -the [Getting Started](http://socket.io/get-started/chat/) guide +This is the source code for a very simple chat example used for +the [Getting Started](http://socket.io/get-started/chat/) guide of the Socket.IO website. Please refer to it to learn how to run this application. + +You can also spin up a free Heroku dyno to test it out: + +[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/guille/chat-example) diff --git a/app.json b/app.json new file mode 100644 index 00000000..89040183 --- /dev/null +++ b/app.json @@ -0,0 +1,22 @@ +{ + "name": "Socket-Chat-Example", + "description": "my first socket.io app", + "website": "https://github.com/guille/chat-example", + "repository": "https://github.com/guille/chat-example", + "logo": "https://node-js-sample.herokuapp.com/node.svg", + "success_url": "/", + "keywords": [ + "node", + "express", + "socket.io", + "realtime", + "websocket" + ], + "scripts": { + }, + "addons": [ + ], + "env": { + "BUILDPACK_URL": "https://github.com/heroku/heroku-buildpack-nodejs" + } +} diff --git a/index.js b/index.js index 6ffcb1db..08b50a76 100644 --- a/index.js +++ b/index.js @@ -12,6 +12,6 @@ io.on('connection', function(socket){ }); }); -http.listen(3000, function(){ - console.log('listening on *:3000'); +http.listen(process.env.PORT || 3000, function(){ + console.log('listening on *:' + http.address().port); }); diff --git a/package.json b/package.json index 7186963a..f2e6fab5 100644 --- a/package.json +++ b/package.json @@ -5,5 +5,8 @@ "dependencies": { "express": "4.3.1", "socket.io": "1.0.2" + }, + "scripts": { + "start": "node index.js" } }