我正试图在我的Express路线中使用req.user
将res.locals
详细信息传递给我的客户端Angular代码:
'use strict';
var path = require('path');
var player = function(req, res) {
res.locals.player = req.player;
res.sendFile(path.join(__dirname, '../assets', 'index.html'));
};
module.exports = {
player: player
};
HTML按预期呈现,但我现在不确定如何访问res.locals.player
。