feat:搭建项目结构
This commit is contained in:
30
main.py
Normal file
30
main.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from flask import *
|
||||
|
||||
from init import init_all
|
||||
from conf.util import *
|
||||
|
||||
# from web import app
|
||||
from web.api import api_bp
|
||||
from web.page import page_bp
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
# 获取配置对象
|
||||
conf = get_config_object()
|
||||
|
||||
# 注册路由
|
||||
app.register_blueprint(api_bp)
|
||||
app.register_blueprint(page_bp)
|
||||
|
||||
# 启动
|
||||
if __name__ == '__main__':
|
||||
# 初始化
|
||||
init_all()
|
||||
|
||||
# 运行Kafka与Spark相关
|
||||
# run_kafka_spark()
|
||||
|
||||
# 运行Web服务
|
||||
app.run(host=conf.get('web', 'host'), port=conf.get('web', 'port'), debug=conf.get('web', 'debug'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user