Skip to content

Commit

Permalink
deprecate connect(middleware)
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Jun 20, 2014
1 parent 27df810 commit b6d364d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions History.md
@@ -1,6 +1,7 @@
unreleased
==========

* deprecate `connect(middleware)` -- use `app.use(middleware)` instead
* deprecate `connect.createServer()` -- use `connect()` instead
* deps: compression@~1.0.8
* deps: errorhandler@~1.1.1
Expand Down
6 changes: 6 additions & 0 deletions lib/connect.js
Expand Up @@ -68,9 +68,15 @@ function createServer() {
utils.merge(app, EventEmitter.prototype);
app.route = '/';
app.stack = [];

if (arguments.length !== 0) {
deprecate('connect(middleware): use app.use(middleware) instead');
}

for (var i = 0; i < arguments.length; ++i) {
app.use(arguments[i]);
}

return app;
};

Expand Down

0 comments on commit b6d364d

Please sign in to comment.