I came across a simple solution and figured I'd post it, in case anyone else was trying to concat strings within their res.locals.
app.use(function (req, res, next) {
req.locals = {
ver: '1.0'
},
res.locals = {
title: 'Awesome App ' + req.locals.ver,
author: 'Jack Diddly'
};
next();
});
Basically, you cannot use or request res.locals within the same array. However, that doesn't stop you from initiating a primary array (in this case, req.locals), and then assigning those to what would be your secondary array (which is now res.locals.)
You don't need to name the primary array req.locals, either. Settling for req.ver works as well, but I think naming the array with locals, groups it with a relative name.