ការភ្ជាប់​ផ្លូវ
នៅ​ក្នុង​កម្មវិធី​គេហទំព័រ​ដោយ​ប្រើប្រាស់​កញ្ចប់ Flask ដែល​ហៅ​ថា​ ការភ្ជាប់ផ្លូវ (routing) គឺ​ជា​ការ​ភ្ជាប់​អាស័យដ្ឋាន​ទាំងឡាយ (URL) ​ទៅ​នឹង​ទំព័រ​ HTML ដែល​នឹង​ត្រូវ​បង្កើត​ឡើង ដោយ​កូដ​ជា​ភាសា Python ​។ ហើយ​ការភ្ជាប់​ផ្លូវ​នេះ ត្រូវ​ធ្វើ​ឡើង​តាម​រយៈ decorator ដែល​ជា method ឈ្មោះ route() ។ ពិនិត្យ​កម្មវិធី​ខាង​ក្រោម​នេះ៖
#c:\flask\index.py
from flask import Flask
app = Flask(__name__)

@app.route('/')
def index():
    return 'Index Page'

@app.route('/hello')
def hello():
    return 'Hello, World'
ជាលទ្ធផល នៅ​ពេល​កម្មវិធី​ខាង​លើ​នេះ​ដំណើរការ បើ​សិន​ជា​មាន​ការចុច​ចូល​មើល​ទំព័រ​ដើម ដែល​មាន​អាស័យដ្ឋាន​ជា http://localhost:5000/, function ឈ្មោះ index() នឹង​ត្រូវ​យក​ទៅ​ប្រើ​ជា​ស្វ័យប្រវត្តិ ដែល​នឹង​បណ្តាល​អោយ​ប្រយោគ "Index Page" ត្រូវ​សរសេរ​នៅ​លើ​ផ្ទៃ browser ។ តែ​បើ​សិន​ជា​មាន​ការចុច​ចូល​ទៅ​កាន់​ទំព័រ​ដែល​មាន​អាស័យដ្ខាន​ជា http://localhost:5000/hello វិញ function ឈ្មោះ hello() នឺង​ត្រូវ​យក​ទៅ​ប្រើ​។

លើស​ពី​នេះ​ទៀត យើង​ក៏អាច​ភ្ជាប់​ផ្លូវ​មាន​ប៉ារ៉ាមែត​ទៅ​នឹង function និង​ឬ method ទាំងឡាយ​បាន​ដូច​គ្នា​ដែរ ដោយ​ធ្វើ​ដូច​ខាង​ក្រោម​នេះ៖
#c:\flask\index.py
from flask import Flask
app = Flask(__name__)

from markupsafe import escape

@app.route('/user/<username>')
def show_user_profile(username):
    # show the user profile for that user
    return 'User %s' % escape(username)

@app.route('/post/<int:post_id>')
def show_post(post_id):
    # show the post with the given id, the id is an integer
    return 'Post %d' % post_id

@app.route('/path/<path:subpath>')
def show_subpath(subpath):
    # show the subpath after /path/
    return 'Subpath %s' % escape(subpath)
Converter types:
string (default) accepts any text without a slash
int accepts positive integers
float accepts positive floating point values
path like string but also accepts slashes
uuid accepts UUID strings