ソースを参照

Flask is implemented with a Router module to parse and deal with url elements and params

Roland Haroutiounian 8年前
コミット
bbb4756f57
3個のファイルの変更23行の追加0行の削除
  1. 1
    0
      Router/__init__.py
  2. 4
    0
      Router/urls.py
  3. 18
    0
      lodel.py

+ 1
- 0
Router/__init__.py ファイルの表示

@@ -0,0 +1 @@
1
+from urls import *

+ 4
- 0
Router/urls.py ファイルの表示

@@ -0,0 +1,4 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+# This module contains the different functions used to deal with the Lodel 2 urls
4
+

+ 18
- 0
lodel.py ファイルの表示

@@ -0,0 +1,18 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+from flask import Flask
4
+from flask import request
5
+
6
+import Router
7
+
8
+app = Flask(__name__)
9
+
10
+
11
+@app.route('/', defaults={'path':''})
12
+@app.route('/<path:path>')
13
+def index(path):
14
+    return "%s" % path
15
+
16
+
17
+if __name__ == '__main__':
18
+    app.run()

読み込み中…
キャンセル
保存