title: How to pass variable from app.js to routes/index.js?
body: <p>I'm using shrinkroute <a href="https://npmjs.org/package/shrinkroute" rel="noreferrer">https://npmjs.org/package/shrinkroute</a> to make links in nodejs. I get error 500 ReferenceError: shrinkr is not defined</p>
  
  <p>How to pass shrinkroute to routes/index.js? Is there a better way to create url by passing query string args?</p>
  
  <pre><code>//app.js
  var app = express();
  
  var shrinkr = shrinkroute( app, {
      "user": {
          path: "/user/:id?",
          get: routes.showOrListUsers
      }
  });
  //url method works in app.js    
  var url = shrinkr.url( "user", { id: 5, page:40, type:'a' } );
  console.log(url);
  
  app.use( shrinkr.middleware );
  
  //routes/index.js
  exports.showOrListUsers = function(req, res, next) {                       
      console.log(req.params); 
      //shrinkr errors out in index.js                                      
      var url2 = shrinkr.url( "users", {name: "foo"});                       
      console.log(url2);                                                                         
  }      
  </code></pre>