Skip to content

Commit bddf652

Browse files
committed
Add express 3.0 instructions on Readme.md
1 parent 6afbb34 commit bddf652

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Readme.md

+19
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@ var io = require('socket.io');
2121
Next, attach it to a HTTP/HTTPS server. If you're using the fantastic `express`
2222
web framework:
2323

24+
#### Express 3.x
25+
26+
```js
27+
var app = express()
28+
, server = require('http').createServer(app)
29+
, io = io.listen(server);
30+
31+
server.listen(80);
32+
33+
io.sockets.on('connection', function (socket) {
34+
socket.emit('news', { hello: 'world' });
35+
socket.on('my other event', function (data) {
36+
console.log(data);
37+
});
38+
});
39+
```
40+
41+
#### Express 2.x
42+
2443
```js
2544
var app = express.createServer()
2645
, io = io.listen(app);

0 commit comments

Comments
 (0)