summaryrefslogtreecommitdiffstats
path: root/flask-without-decorator.py
diff options
context:
space:
mode:
Diffstat (limited to 'flask-without-decorator.py')
-rw-r--r--flask-without-decorator.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/flask-without-decorator.py b/flask-without-decorator.py
new file mode 100644
index 0000000..a63a989
--- /dev/null
+++ b/flask-without-decorator.py
@@ -0,0 +1,9 @@
+from flask import Flask
+app = Flask(__name__)
+
+def say_hello():
+ return "hello, world!"
+app.add_url_rule("/hello", "sayhello", say_hello) # 1st param: URL pathname, 2nd: flask's internal name of endpoint, 3rd: func to call to reply
+
+if __name__ == '__main__':
+ app.run() \ No newline at end of file