Browse Source

Docs: Add example for 'any' route converter

pull/2650/head
Grey Li 7 years ago committed by GitHub
parent
commit
6ca75c6fc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docs/api.rst

4
docs/api.rst

@ -692,6 +692,10 @@ Here are some examples::
@app.route('/post/<int:post_id>')
def show_post(post_id):
pass
@app.route('/lang/<any(en, zh):lang_code>') # or <any("en", "zh"):lang_code>
def set_language(lang_code):
pass
An important detail to keep in mind is how Flask deals with trailing
slashes. The idea is to keep each URL unique so the following rules

Loading…
Cancel
Save