title: How to get JWT token from URL using Express server?
body: <p>Supposing the URL is like <code>http://localhost:3000/auth?token=helloworld</code></p>
  
  <p>How to get the jwt token from this url using express server? I have tried this code below.. no output.</p>
  
  <pre><code>var express = require('express');
  var app = express();
  var router = express.Router();
  
      router.use(function(req, res, next) {
      var token = req.query.token;
      console.log(token);
      try {
          var decoded = jwt.verify(token, 'thisismysecretstring');
          console.log(decoded);
          res.send(req.query.token);
      } catch (err) {
          console.log(err);
      }
  });
  
  app.use('/auth', router);
  </code></pre>