title: How to implement `jwt` using express js in mvc pattern?
body: <p>I have gone through this <a href="https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens" rel="nofollow">link</a>. How can I implement this in mvc pattern?</p>
  
  <p>This is my file structure</p>
  
  <pre><code>config
     |----mongo.js      //connection to mongoose
     |----routes.js     //all routes of all controllers
  controllers
     |----controller.js //all controller files
  models
     |----model.js      //all models nothing but schemas of different collections
  package.json
  server.js
  </code></pre>
  
  <p>How to implement jwt in the above pattern so that it can be applied to all routes. Please help me out.</p>