title: How to call jwt verification function from routes?
body: <p><strong>verify_jwt_token</strong></p>
  
  <pre><code>var jwt = require('jsonwebtoken');
  var config = require('./env/config.json')
  
  module.exports = function(req,res,next) {
    var token = req.body.token || req.query.token || req.headers['x-access-token'];
      if (token) {
          console.log("----------------------------------------");
          console.log(token);
          console.log("----------------------------------------");
  
          console.log(config.jwt_secret);
          console.log("----------------------------------------");
  
      // verifies secret and checks exp
          jwt.verify(token, config.jwt_secret, function(err, decoded) {
              if (err) { //failed verification.
                  return res.json({"error": true});
              }
              req.decoded = decoded;
              next(); //no error, proceed
          });
      } else {
          // forbidden without token
          return res.status(403).send({
              "error": true
          });
      }
  }
  </code></pre>
  
  <p><strong>Routes</strong></p>
  
  <pre><code> var user  = require('../controller/user.controller.js');
   var token_verify = require('../../config/verify_jwt_token.js')
  
  module.exports = function (app) {
  
  app.route('/register_user').post(user.register);
  app.route('/login').get(user.login);
  
  
  app.route('/auth',token_verify).get(user.auth);
  
  
  }
  </code></pre>
  
  <p>I want to call j w t verification function from this route.I don't want to call from the controller. app.route('/auth',token_verify).get(user.auth); Calling from this route
   Please help. 
  Thank you in advance. </p>