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

@ -693,6 +693,10 @@ Here are some examples::
def show_post(post_id): def show_post(post_id):
pass 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 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 slashes. The idea is to keep each URL unique so the following rules
apply: apply:

Loading…
Cancel
Save