title: Flask Route Pattern Matching Order
body: <p>Given that <a href="http://flask.pocoo.org/docs/design/#the-routing-system" rel="noreferrer">Flask Routes are not pattern matched from top to bottom</a>, how does one deal with the following problem?</p>
  
  <p>I have the following routes:</p>
  
  <ol>
  <li><code>/&lt;poll_key&gt;/close</code></li>
  <li><code>/&lt;poll_key&gt;/&lt;participant_key&gt;</code></li>
  </ol>
  
  <p>If I make a request to <code>http://localhost:5000/example-poll-key/close</code>, Flask matches it as pattern 2, assigning the string 'close' to the <code>&lt;participant_key&gt;</code> URL parameter. How can I make the <code>&lt;poll_key&gt;/close</code> route get matched before the <code>&lt;participant_key&gt;</code> route?</p>