update express middleware for exp 4.x

res.locals has been converted to an object from a function in express 4.x.