<h4>Arguments</h4>

<div class="table-scroller">
  <table>
    <thead>
      <tr>
        <th scope="col">Argument</th>
        <th scope="col">Description</th>
        <th scope="col">Default</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row"><code>path</code></th>
        <td>
          The path for which the middleware function is invoked; can be any of:
          <ul>
            <li>A string representing a path.</li>
            <li>A path pattern.</li>
            <li>A regular expression pattern to match paths.</li>
            <li>An array of combinations of any of the above.</li>
          </ul>
          For examples, see <a href="#path-examples">Path examples</a>.
        </td>
        <td>'/' (root path)</td>
      </tr>
      <tr>
        <th scope="row"><code>callback</code></th>
        <td>
          Callback functions; can be:
          <ul>
            <li>A middleware function.</li>
            <li>A series of middleware functions (separated by commas).</li>
            <li>An array of middleware functions.</li>
            <li>A combination of all of the above.</li>
          </ul>
          <p>
            You can provide multiple callback functions that behave just like middleware, except
            that these callbacks can invoke <code>next('route')</code> to bypass
            the remaining route callback(s). You can use this mechanism to impose pre-conditions
            on a route, then pass control to subsequent routes if there is no reason to proceed with the current route.
          </p>
          <p>
            Since <a href="#router">router</a> and <a href="#application">app</a> implement the middleware interface,
            you can use them as you would any other middleware function.
          </p>
          <p>
            For examples, see <a href="#middleware-callback-function-examples">Middleware callback function examples</a>.
          </p>
        </td>
        <td>None</td>
      </tr>
    </tbody>
  </table>
</div>