javascript - Including a response header with res.redirect -


a node.js app needs to:

1.) receive data serve calls /some_endpoint,
2.) process data receives create string result jwtstring,
3.) redirect user root / url of angularjs app while passing jwtstring res.header included inside res.redirect.

what specific changes need made node.js routing code below in order _jwt header passed node.js app client angularjs @ at /?

app.get('/some_endpoint', function(req, res) {     //process data server redirected here.     //then send result of processing in jwtstring while      //redirecting user root url of angular app     //is served node.js instance.     res.setheader('_jwt', jwtstring);     res.redirect('/'); });  app.get('*', function(req, res) {     var querydata = url.parse(req.url, true);     console.log('in *, querydata is: ');console.log(querydata);     res.sendfile('./public/index.html'); // load single view file (angular handle front-end) }); 

when run code above, cannot seem find _jwt header in network tab of firefox developer tools.


Comments