Procházet zdrojové kódy

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

Roland Haroutiounian před 8 roky
rodič
revize
bbb4756f57
3 změnil soubory, kde provedl 23 přidání a 0 odebrání
  1. 1
    0
      Router/__init__.py
  2. 4
    0
      Router/urls.py
  3. 18
    0
      lodel.py

+ 1
- 0
Router/__init__.py Zobrazit soubor

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

+ 4
- 0
Router/urls.py Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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()

Loading…
Zrušit
Uložit