title: Catch-all root level routing in Express.js: considerations and reserving possible routes for future use?
body: <p>I'm using Express.js (3.0) to develop a Node web app; I'd like to have clean URLs for both user profiles:</p>
  
  <p><strong>domain.com/username</strong></p>
  
  <p>as well as for pages each user creates and shares:</p>
  
  <p><strong>domain.com/username/pagename</strong></p>
  
  <p>I really prefer the clean URLs to using something like <strong>domain.com/profile/username</strong> or <strong>domain.com/pages/username/pagename</strong>.</p>
  
  <p>The current route configuration for our development is bootstrapped like so:</p>
  
  <pre><code>app.get('/', content.home);
  app.get('/about', content.about);
  app.get('/signup', users.signup);
  app.get('/login', users.login);
  app.get('/:user', users.profile);
  app.get('/:user/:userpage', userpage.render);
  </code></pre>
  
  <p>The last two being the catch all routes. Now this works fine, but I'm not sure if it's a bad design or implementation.</p>
  
  <p>More importantly, I'd like to reserve a 100 or so page names for future use, like 'contact', 'careers', 'cancels', 'pricing', etc. I don't plan to launch with these pages, but I'm wondering if I can create a route file that captures these requests and sends them to a placeholder page, rather than them being evaluated as a user profile or user generated page.</p>
  
  <p>I can obviously prevent those usernames from being created, but there's got to be a creative approach for the routing as well, and understand any other considerations when using catch-all root level routing-- this can cause an unwieldily amount of DB strain due to the user and page look ups for non-existing objects or pages.</p>