App routing is used to map the specific URL with the associated function that is intended to perform some task. It is used to access some particular page like Flask Tutorial in the web application.
In our first application, the URL (‘/’) is associated with the sample function that returns a particular string displayed on the web page.
the URL (‘/home’) is associated with the sample2 function that returns a particular string displayed on the web page.
CODE:
` import flask
from flask import Flask
create an instance(app)
app = Flask(name)
Normal Route
@app.route(‘/’)
define a method
def sample():
return “<b>WELCOME TO MY WEBPAGE</b>”
@app.route(“/home”)
def sample2():
return “HOME PAGE”
if name == ‘main’:
app.run()`
OUTPUT: