forked from nicholsons/comp0034-wk1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app1.py
21 lines (16 loc) · 772 Bytes
/
app1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Import the Flask class from the Flask library
from flask import Flask
# Create an instance of a Flask application
# The first argument is the name of the application’s module or package. __name__ is a convenient shortcut.
# This is needed so that Flask knows where to look for resources such as templates and static files.
app = Flask(__name__)
# Add a route for the 'home' page
# use the route() decorator to tell Flask what URL should trigger our function.
@app.route('/')
def hello_world():
# The function returns the message we want to display in the user’s browser. The default content type is HTML,
# so HTML in the string will be rendered by the browser.
return 'Hello World!'
# Run the app
if __name__ == '__main__':
app.run(debug=True)