I would like to capture a token that I set in the http header inside my Angular application.
This is how I am serving my Angular application :
var express = require('express');
var app = express();
var port = process.env.PORT || 3000;
var router = express.Router();
var utils = require('./utils);
console.log('——————————- Run on port '+ port);
/****************************** Router ***************************/
router.get('*', function(req, res){
token = utils.generateToken();
res.set('X-Auth', token).sendFile('index.html', { root: __dirname + '/public/app' });
});
This token that I am setting in the header is what I would like to capture inside my Angular application. I am kind of lost on where and how to do that ? I am using Angular 9. Any hints where to start ?