How to access res.locals client side

I am trying to pass data req.user

to my client Angular code using res.locals

in my express route:

'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 displays as expected, but I'm not sure how to access it res.locals.player

now.

+3


source to share





All Articles