title: Define a base url in Backbone.js router
body: <p>I want to be able to specify a base url for all my routes for development. Some of the devs have machines setup to work out of subdirectories instead of the application sitting at the webroot.
  I would like to only define these routes once.
  Instead of:
      routes: {
          "toms-subdirectory/users": "init_users"
      }
  I would like:</p>
  
  <pre><code>routes: {
      "/users": "init_users"
  }
  </code></pre>
  
  <p>and be able to specify a baseurl for that installation so I could easily make it work across installs.</p>
  
  <p>Right now I'm forcing them by defining a route object using bracket syntax to keep the dynamic keys and assigning that to the routes property inside the route. I was wondering if there is a cleaner way.</p>
  
  <pre><code>my_routes = {};
  my_routes[window.webroot + '/users'] = 'init_users';
  
  MyRoute = Backbone.Router.extend({ routes: my_routes })
  </code></pre>