//doT defaults
expressDoT.settings.dot = {
evaluate: /[[([\s\S]+?)]]/g,
interpolate: /[[=([\s\S]+?)]]/g,
encode: /[[!([\s\S]+?)]]/g,
use: /[[#([\s\S]+?)]]/g,
define: /[[##\s_([\w.$]+)\s_(:|=)([\s\S]+?)#]]/g,
conditional: /[[?(?)?\s_([\s\S]?)\s]]/g,
iterate: /[[~\s_(?:]]|([\s\S]+?)\s_:\s_([\w$]+)\s_(?::\s_([\w$]+))?\s*]])/g,
varname: 'layout, model',
strip: false,
append: true,
selfcontained: false
};
//server side
var context = {
csrf: req.csrfToken(),
navbar: 'map',
accountTypeID: req.session.accountTypeID,
accountID: req.session.accountID,
accountUsername: req.session.accountUsername,
accountEmail: req.session.accountEmail,
accountName: req.session.accountName,
accountPhoto: req.session.accountPhoto,
accountReference: req.session.accountReference,
payload: payload
};
res.render('map/index-view.dot', context);
//inside index-view.dot
[[= model.csrf ]]
[[= JSON.stringify(model) ]]
Both say undefined