Compare commits
No commits in common. "main" and "dev" have entirely different histories.
@ -1,7 +1,6 @@
|
||||
[server]
|
||||
port-web=8080
|
||||
port-api=8081
|
||||
debug=0
|
||||
port=8080
|
||||
debug=1
|
||||
host=0.0.0.0
|
||||
threaded=1
|
||||
|
||||
|
35
main.py
35
main.py
@ -1,7 +1,6 @@
|
||||
from flask import Flask
|
||||
|
||||
import app_conf
|
||||
import threading
|
||||
|
||||
from web.api.receive import api_receive_bp
|
||||
from web.page import page_bp
|
||||
@ -10,31 +9,15 @@ from web.page import page_bp
|
||||
conf = app_conf.conf()
|
||||
|
||||
|
||||
|
||||
def runapp1():
|
||||
app1 = Flask(__name__)
|
||||
app1.register_blueprint(page_bp)
|
||||
app1.run(
|
||||
debug=conf.getboolean("server", "debug"),
|
||||
host=conf.get("server", "host"),
|
||||
port=conf.get("server", "port-web"),
|
||||
threaded=conf.getboolean("server", "threaded"),
|
||||
)
|
||||
def runapp2():
|
||||
app2 = Flask(__name__)
|
||||
app2.register_blueprint(api_receive_bp)
|
||||
app2.run(
|
||||
debug=conf.getboolean("server", "debug"),
|
||||
host=conf.get("server", "host"),
|
||||
port=conf.get("server", "port-api"),
|
||||
threaded=conf.getboolean("server", "threaded"),
|
||||
)
|
||||
app = Flask(__name__)
|
||||
app.register_blueprint(page_bp)
|
||||
app.register_blueprint(api_receive_bp)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
thread1 = threading.Thread(target=runapp1)
|
||||
thread2 = threading.Thread(target=runapp2)
|
||||
thread1.start()
|
||||
thread2.start()
|
||||
|
||||
|
||||
app.run(
|
||||
debug=conf.getboolean("server", "debug"),
|
||||
host=conf.get("server", "host"),
|
||||
port=conf.get("server", "port"),
|
||||
threaded=conf.getboolean("server", "threaded"),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user