Skip to content

Instantly share code, notes, and snippets.

@avielb
Last active June 7, 2021 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avielb/6cbe5f158dc99eb5c534b231faef6b71 to your computer and use it in GitHub Desktop.
Save avielb/6cbe5f158dc99eb5c534b231faef6b71 to your computer and use it in GitHub Desktop.
# import flask package
from flask import Flask
# create a flask application. we will use it to run the app later
app = Flask(__name__)
# define an http path to match a python function, in this case when going to http://127.0.0.1:5000/
# this function will be called. it's return will be used to response the http call
@app.route('/')
def home():
return "Hey there!"
# main scope for python
if __name__ == '__main__':
# run the flask application itself. here we can configure it's listen port and address
app.run(debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment