middleware.js
This file
Path
benchmarks/middleware.js
22 lines · 343 bytes · JavaScript
Last changed by
lint: remove all unused varaiblesDouglas Christopher Wilsonbefore adoptione006622
History of this fileTake it
1234567891011121314151617181920212223
var express = require('..');var app = express();
// number of middleware
var n = parseInt(process.env.MW || '1', 10);console.log(' %s middleware', n);
while (n--) { app.use(function(req, res, next){ next(); });}
var body = new Buffer('Hello World');
app.use(function(req, res, next){ res.send(body);});
app.listen(3333);