Joined September 2014
·

Stuart McGrigor

Wellington, New Zealand
·
·

try this instead:
server.use(function(req, res, next) {
res.redirect = function(addr) {
res.header('Location', addr);
res.send(302);
}
done();
});

Note you're adding the redirect function to each response object, inside a middleware function, so you need to let the middleware keep going.

Achievements
1 Karma
0 Total ProTip Views