title: NodeJS/Express API versioning
body: <p>I'd like to set up an API versioning, similar to how Stripe does it but I'm not quite sure how to make express do what I need. <a href="https://stripe.com/docs/api#versioning" rel="noreferrer">https://stripe.com/docs/api#versioning</a></p>
  
  <p>What I'm looking for is, the proper route would be something like:</p>
  
  <p>/api/v1/call</p>
  
  <p>The kicker is, I'd like them to pass in a version revision like stripe allows, so if they sent a header like "API-Version: 2015-08-15", it would map to that specific version of the major version. So, v1 but the version updated on 2015-08-15.</p>
  
  <p>Essentially, if there is an update to the API call that is not backwards compatible, I'd roll a new version for that particular call. Express would be smart enough to know that if a version isn't passed, use the latest. If a version is passed, use the latest version for each call up until the version date.</p>
  
  <p>I'd assume the directory structure would be something like:</p>
  
  <ul>
  <li>/router/</li>
  <li>/router/v1</li>
  <li>/router/v1/call</li>
  <li>/router/v1/anotherCall</li>
  </ul>
  
  <p>And maybe in the call directories, there is a index that checks for the header version and uses the proper file.</p>
  
  <p>So maybe for instance</p>
  
  <ul>
  <li>/router/v1/call/index.js</li>
  <li>/router/v1/call/20150810.js -- First version</li>
  <li>/router/v1/call/20150815.js -- Updated version that isn't backwards compat.</li>
  </ul>
  
  <p>Thoughts? Ideas?</p>