Browse files

Add express 3.0 instructions on Readme.md

  • Loading branch information...
1 parent 6afbb34 commit bddf652c25cd839222488bd3092c44c982ec981a @coreh coreh committed Jul 30, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 Readme.md
View
19 Readme.md
@@ -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);

0 comments on commit bddf652

Please sign in to comment.