Skip to content

Commit

Permalink
heroku compatibility
Browse files Browse the repository at this point in the history
port env var

added app.json

formatting

free dyno
  • Loading branch information
hunterloftis committed Sep 21, 2014
1 parent 78c6ffc commit 0cc637c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
22 changes: 22 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"dependencies": {
"express": "4.3.1",
"socket.io": "1.0.2"
},
"scripts": {
"start": "node index.js"
}
}

0 comments on commit 0cc637c

Please sign in to comment.