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

remove old deprecation warnings #3217

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions lib/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,37 +66,3 @@ exports.Router = Router;
*/

exports.static = require('serve-static');

/**
* Replace removed middleware with an appropriate error message.
*/

[
'json',
'urlencoded',
'bodyParser',
'compress',
'cookieSession',
'session',
'logger',
'cookieParser',
'favicon',
'responseTime',
'errorHandler',
'timeout',
'methodOverride',
'vhost',
'csrf',
'directory',
'limit',
'multipart',
'staticCache',
'query',
].forEach(function (name) {
Object.defineProperty(exports, name, {
get: function () {
throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');
},
configurable: true
});
});
8 changes: 0 additions & 8 deletions test/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,4 @@ describe('exports', function(){
.get('/')
.expect('bar', done);
})

it('should throw on old middlewares', function(){
var error;
try { express.bodyParser; } catch (e) { error = e; }
should(error).have.property('message');
error.message.should.containEql('middleware');
error.message.should.containEql('bodyParser');
})
})