Skip to content

Commit e417161

Browse files
authored
Merge pull request #11 from MDA2AV/MDA2AV-patch-1
Update Flask server routing and change default port
2 parents 687f035 + bbdb768 commit e417161

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/Servers/FlaskServer/app.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import sys
22
from flask import Flask
3+
from werkzeug.routing import Rule
34

45
app = Flask(__name__)
56

6-
@app.route("/", defaults={"path": ""})
7-
@app.route("/<path:path>")
7+
app.url_map.add(Rule('/', defaults={"path": ""}, endpoint='catch_all'))
8+
app.url_map.add(Rule('/<path:path>', endpoint='catch_all'))
9+
10+
@app.endpoint('catch_all')
811
def catch_all(path):
912
return "OK"
1013

1114
if __name__ == "__main__":
12-
port = int(sys.argv[1]) if len(sys.argv) > 1 else 9002
15+
port = int(sys.argv[1]) if len(sys.argv) > 1 else 8080
1316
app.run(host="0.0.0.0", port=port)

0 commit comments

Comments
 (0)