Skip to content

Commit 9028dae

Browse files
committed
added DispatcherMiddleware attempt to combine apps
1 parent 5fd8fd3 commit 9028dae

4 files changed

Lines changed: 46 additions & 0 deletions

File tree

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
export FLASK_APP=app.py
3+
4+
all: run
5+
6+
run:
7+
python3 -m flask run

app.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from werkzeug.wsgi import DispatcherMiddleware
2+
3+
import front as frontend
4+
from front import app as front
5+
#from Tema1 import tema_GUI as tema1
6+
7+
8+
# flask version
9+
from flask import Flask
10+
application = Flask(__name__)
11+
12+
application.wsgi_app = DispatcherMiddleware(front, {
13+
'/tema1': tema1
14+
})
15+
16+
application.run(debug=True)
17+
18+
# wsgi version
19+
# from werkzeug.serving import run_simple
20+
#
21+
# application = DispatcherMiddleware(frontend, {
22+
# '/tema1': tema1
23+
# })
24+
25+
# if __name__ == '__main__':
26+
# run_simple('localhost', 5000, application,
27+
# use_reloader=True, use_debugger=True, use_evalex=True)

front.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from flask import Flask, jsonify
2+
app = Flask(__name__)
3+
4+
5+
@app.route('/')
6+
def hello():
7+
return jsonify({
8+
"info": "Check subdomains like: tema[1-6]/"
9+
})

make.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set FLASK_APP=app.py
2+
python -m flask run
3+
PAUSE

0 commit comments

Comments
 (0)