middleware.js
This file
Path
benchmarks/middleware.js
23 lines · 371 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than ad3ca25 point at it.
deps: qs@1.2.2Douglas Christopher Wilsonbefore adoptionad3ca25
lines 1–23why, one step back12var http = require('http');3var express = require('..');4var app = express();56// number of middleware78var n = parseInt(process.env.MW || '1', 10);9console.log(' %s middleware', n);1011while (n--) {12 app.use(function(req, res, next){13 next();14 });15}1617var body = new Buffer('Hello World');1819app.use(function(req, res, next){20 res.send(body);21});2223app.listen(3333);