Flask Path or route parameters

In addition to having routes for fixed pathes, Flask can also handle routes where one or more parts of the path can have any value.

It can be especially useful if the response is then looked up in some sort of a database.

from flask import Flask
app = Flask(__name__)

def index():
    return '''
<a href="/user/23">23</a><br>
<a href="/user/42">42</a><br>
<a href="/user/Joe">Joe</a><br>

def api_info(uid):
    return uid

FLASK_APP=app.py FLASK_DEBUG=0  flask run