From c1b1dc7e19cb407ff8aa9d08436c9fc3c4850fed Mon Sep 17 00:00:00 2001 From: Jan-Oliver Pantel Date: Fri, 27 Dec 2013 13:32:33 +0100 Subject: [PATCH] Update express middleware for express.io Express.io does not use the response object, so in the middleware the second argument will be the "next()" function. This fix allows it to use orm with express.io. --- lib/Express.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Express.js b/lib/Express.js index 37bad496..8851d796 100644 --- a/lib/Express.js +++ b/lib/Express.js @@ -47,6 +47,11 @@ module.exports = function (uri, opts) { req.db = _db; } + if (next === undefined && typeof res === 'function') + { + next = res; + } + if (_pending > 0) { _queue.push(next); return;