title: conditionally use a middleware depending on request parameter express
body: <p>I am trying to decide on a middleware to use based on request query parameter.</p>
  
  <p>in the main module I have something like this:</p>
  
  <pre><code>app.use(function(req, res){
    if (req.query.something) {
      // pass req, res to middleware_a
    } else {
      // pass req, res to middleware_b
    }
  });
  </code></pre>
  
  <p><code>middleware_a</code> and <code>middleware_b</code> are <strong>both express apps</strong> themselves created by <code>express()</code> function and not regular middleware functions (<code>function(req, res, next)</code>)</p>
  
  <p>can't find a way to do it</p>