34 lines
1.4 KiB
Python

from flask import Flask
from config import load_config
from controller.view.main_blueprint import blueprint as view_main_blueprint
from controller.api.config_blueprint import blueprint as api_config_blueprint
from controller.api.collector_blueprint import blueprint as api_collector_blueprint
from controller.api.bilirecorder_blueprint import blueprint as api_bilirecorder_blueprint
from controller.api.workflow_blueprint import blueprint as api_workflow_blueprint
from controller.api.video_clip_blueprint import blueprint as api_video_clip_blueprint
from controller.api.danmaku_clip_blueprint import blueprint as api_danmaku_clip_blueprint
from model import db
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
# CORS(app, supports_credentials=True)
load_config()
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///database.db?check_same_thread=False"
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
app.config['SQLALCHEMY_ECHO'] = True
db.init_app(app)
app.register_blueprint(view_main_blueprint)
app.register_blueprint(api_config_blueprint)
app.register_blueprint(api_collector_blueprint)
app.register_blueprint(api_bilirecorder_blueprint)
app.register_blueprint(api_workflow_blueprint)
app.register_blueprint(api_video_clip_blueprint)
app.register_blueprint(api_danmaku_clip_blueprint)
with app.app_context():
# db.drop_all(app=app)
db.create_all(app=app)
if __name__ == '__main__':
app.run()