-2

I am attempting to use functions inside of flask, but I don't know how to properly do it.

How do I define the functions,

Example

def foo(a, b):
    ...

1 Answers1

1
from flask import *
app = Flask(__name__)

@app.route("/")
def index():
  return "<h1>Hello World</h1>"

if __name__ == "__main__":
  app.run(host="0.0.0.0", port=8080, debug=False)

for example index is a function example that will run in the specified address below.

Ali Mansur
  • 61
  • 1
  • 4