File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# chat-example
22
3- This is the source code for a very simple chat example used for
4- the [ Getting Started] ( http://socket.io/get-started/chat/ ) guide
3+ This is the source code for a very simple chat example used for
4+ the [ Getting Started] ( http://socket.io/get-started/chat/ ) guide
55of the Socket.IO website.
66
77Please refer to it to learn how to run this application.
8+
9+ You can also spin up a free Heroku dyno to test it out:
10+
11+ [ ![ Deploy] ( https://www.herokucdn.com/deploy/button.png )] ( https://heroku.com/deploy?template=https://github.com/guille/chat-example )
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " Socket-Chat-Example" ,
3+ "description" : " my first socket.io app" ,
4+ "website" : " https://github.com/guille/chat-example" ,
5+ "repository" : " https://github.com/guille/chat-example" ,
6+ "logo" : " https://node-js-sample.herokuapp.com/node.svg" ,
7+ "success_url" : " /" ,
8+ "keywords" : [
9+ " node" ,
10+ " express" ,
11+ " socket.io" ,
12+ " realtime" ,
13+ " websocket"
14+ ],
15+ "scripts" : {
16+ },
17+ "addons" : [
18+ ],
19+ "env" : {
20+ "BUILDPACK_URL" : " https://github.com/heroku/heroku-buildpack-nodejs"
21+ }
22+ }
Original file line number Diff line number Diff line change @@ -12,6 +12,6 @@ io.on('connection', function(socket){
1212 } ) ;
1313} ) ;
1414
15- http . listen ( 3000 , function ( ) {
16- console . log ( 'listening on *:3000' ) ;
15+ http . listen ( process . env . PORT || 3000 , function ( ) {
16+ console . log ( 'listening on *:' + http . address ( ) . port ) ;
1717} ) ;
Original file line number Diff line number Diff line change 55 "dependencies" : {
66 "express" : " 4.3.1" ,
77 "socket.io" : " 1.0.2"
8+ },
9+ "scripts" : {
10+ "start" : " node index.js"
811 }
912}
You can’t perform that action at this time.
0 commit comments