aboutsummaryrefslogtreecommitdiff
path: root/lib/crow/examples/example.py
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-01-15 19:12:12 +0800
committerMistivia <i@mistivia.com>2025-01-15 19:12:46 +0800
commit4da382953c830a61ae24ccbe95c4241db8788269 (patch)
tree31f6d184273274e2660516d1ac1146b5661f20b6 /lib/crow/examples/example.py
restore
Diffstat (limited to 'lib/crow/examples/example.py')
-rw-r--r--lib/crow/examples/example.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/crow/examples/example.py b/lib/crow/examples/example.py
new file mode 100644
index 0000000..1fd8fcd
--- /dev/null
+++ b/lib/crow/examples/example.py
@@ -0,0 +1,19 @@
+from flask import Flask
+app = Flask(__name__)
+
+@app.route("/")
+def hello():
+ return "Hello World!"
+
+@app.route("/about/<path:path>/hello")
+def hello1(path):
+ return "about1"
+
+@app.route("/about")
+def hello2():
+ return "about2"
+
+print app.url_map
+
+if __name__ == "__main__":
+ app.run(host="0.0.0.0", port=8888)