Skip to content

Commit

Permalink
Added support for old style args. Closes #478
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Feb 24, 2012
1 parent 7a6eb9e commit 1dba718
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/connect.js
Expand Up @@ -61,7 +61,7 @@ function createServer() {
utils.merge(app, proto);
utils.merge(app, EventEmitter.prototype);
app.route = '/';
app.stack = [];
app.stack = [].slice.apply(arguments);
return app;
};

Expand Down
9 changes: 9 additions & 0 deletions test/server.js
Expand Up @@ -20,6 +20,15 @@ describe('app', function(){
.expect('http://example.com/foo', done);
})

it('should allow old-style constructor middleware', function(){
var app = connect(
connect.json()
, connect.multipart()
, connect.urlencoded());

app.stack.should.have.length(3);
})

it('should escape the 404 response body', function(done){
var app = connect();
app.request()
Expand Down

0 comments on commit 1dba718

Please sign in to comment.