Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add express 3.0 instructions on Readme.md #972

Merged
merged 1 commit into from Aug 10, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions Readme.md
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