-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (22 loc) · 777 Bytes
/
main.py
File metadata and controls
29 lines (22 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import flask
from routes import default
from flask_cors import CORS
from manager.tasks import TaskManager
from manager.io import SocketIoManager
from manager.app import App
from routes import routes
#import viur
import os
import logging
if __name__ == "__main__":
logging.getLogger().setLevel(logging.DEBUG)
#for k, v in viur.ViurCommandManager().items():
# build_params = "".join([f"<{arg}>/" for arg in v.args])
# App().app.add_url_rule(f"/cmd/{k}/{build_params}", None, v, methods=["GET", "POST"])
for route in routes:
route.__path__ = os.path.dirname(__file__)
App().register_blueprint(route)
TaskManager().start()
SocketIoManager().init_app(App().app)
if __name__ == '__main__':
SocketIoManager().run(App().app, debug=True, host="127.0.0.1", port=9001)