title: Pass JWT in Header
body: <p>I am learning JWT with NodeJs. I am stuck at passing the JWT in header actually i do not know how to do this. </p>
  
  <p><strong>index.js file</strong></p>
  
  <pre><code>var express = require('express'),
   app = express(),
   routes = require('./routes'),
   bodyParser = require('body-parser'),
   path = require('path'),
   ejs = require('ejs'),
   jwt = require('jsonwebtoken');
  
  app.use(bodyParser.urlencoded({ extended: false })); 
  app.use(bodyParser.json());
  
  app.set('views', __dirname + '/views');
  app.set('view engine', 'ejs');
  
  app.post('/home',routes.loginUser);
  
  app.get('/', function(req, res) {
    res.render('index');
  });
  
  app.get('/home',function(req, res) {
    jwt.verify(req.token, 'qwertyu6456asdfghj', function(err, data) {
      if (err) {
        res.sendStatus(403);
      } 
    });
  });
  
   app.listen(3000,function(){
    console.log("Server running at Port 3000");
  });
  </code></pre>
  
  <p><strong>routes/index.js file</strong></p>
  
  <pre><code>var  jwt = require('jsonwebtoken');
  
  exports.home = function(req, res){
    res.render('home',{error: false});
  };
  
  exports.loginUser = function(req, res) {
      var uname = req.body.Username;
      var pwd = req.body.Password;
  
      if(uname &amp;&amp; pwd === 'admin'){
          res.render('home');
  
      var token = jwt.sign({ user: uname }, 'qwertyuiopasdfghj');
      console.log('Authentication is done successfully.....');
      console.log(token);
      }
  
      response.json({
          authsuccess: true,
          description: 'Sending the Access Token',
          token: token
      });
  };
  </code></pre>
  
  <p>when i run the application i am getting the token in <code>console.log</code> but 
  How can I pass token in header and store it in localStorage of browser?</p>