Skip to content

Commit

Permalink
Merge pull request socketio#972 from Coreh/express-3.x-readme
Browse files Browse the repository at this point in the history
Add express 3.0 instructions on Readme.md
  • Loading branch information
rauchg committed Aug 10, 2012
2 parents d10b4dd + bddf652 commit 3a3044e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@ var io = require('socket.io');
Next, attach it to a HTTP/HTTPS server. If you're using the fantastic `express`
web framework:

#### Express 3.x

```js
var app = express()
, server = require('http').createServer(app)
, io = io.listen(server);

server.listen(80);

io.sockets.on('connection', function (socket) {
socket.emit('news', { hello: 'world' });
socket.on('my other event', function (data) {
console.log(data);
});
});
```

#### Express 2.x

```js
var app = express.createServer()
, io = io.listen(app);
Expand Down

0 comments on commit 3a3044e

Please sign in to comment.