I am new to ExpressJS, so I wanted to set a simple string value, I could translate.
So I tried out globalize-express and set the app title like this:
app.use(function (req, res, next) {
console.log("App: " + req.Globalize.formatMessage('strings/title'));
res.locals.title = req.Globalize.formatMessage('strings/title');
next();
});
followed by:
app.use('/', index);
It looks like it is rendering correctly, but the console is posting the error:
Can't set headers after they are sent.
How can I avoid this error?