Skip to content

Commit

Permalink
Readme: added example of using 1.0 and koajs
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Dec 24, 2013
1 parent 760e1b5 commit f0e8826
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ io.on('connection', function(){ // … });
server.listen(3000);
```
### In conjunction with `Koa`
Like Express.JS, Koa works by exposing an application as a request
handler function, but only by calling the `callback` method.
```js
var app = require('koa')();
var server = require('http').Server(app.callback());
var io = require('socket.io')(server);
io.on('connection', function(){ // … });
server.listen(3000);
```
## API
### Server
Expand Down

0 comments on commit f0e8826

Please sign in to comment.