senchalabs/connect — Issue #502: Is there a lightweight way to compose middlewares?
Author: nponeccop
Created: 2012-03-06 11:00:56+00:00
State: open

Sequenz library ( https://github.com/snd/sequenz/blob/master/lib/sequenz.coffee ) provides a helper:

```Javascript
function handle(req, res)
{
...
}

app.get('/frame', sequenz.sequence([connect.compress(), handler]))
```

What is the recommended way to compose middlewares this way? So whatever `handler` outputs gets compressed?