mirror of
https://github.com/KingHWJ/WeReadBoard.git
synced 2026-11-03 18:24:58 +08:00
refactor(api): 去除代码版本命名
This commit is contained in:
1 parent
bbc4bdd140
commit
dcf4cb0719
31 files changed
+174
-154
No files matched your search
@@ -37,15 +37,15 @@ except ImportError:
|
||||
_ssl_context = ssl.create_default_context()
|
||||
from flask import Flask, g, jsonify, render_template, request
|
||||
|
||||
from api_v2 import v2_bp
|
||||
from reading_api import reading_bp
|
||||
|
||||
# ======================================================================
|
||||
# Flask 应用实例
|
||||
# ======================================================================
|
||||
app = Flask(__name__, static_folder="static", template_folder="templates")
|
||||
|
||||
# 注册 v2 数据接口(/api/v2/*,为「阅间」新版前端提供聚合数据)
|
||||
app.register_blueprint(v2_bp)
|
||||
# 注册当前看板数据接口,并保留旧客户端兼容路径。
|
||||
app.register_blueprint(reading_bp)
|
||||
|
||||
# ======================================================================
|
||||
# 数据库连接配置
|
||||
@@ -1343,7 +1343,7 @@ if __name__ == "__main__":
|
||||
else:
|
||||
print(f"[信息] {msg}")
|
||||
|
||||
# 监听端口:默认 8080,可用环境变量 PORT 覆盖(v2 前端与 v1 并存时可换端口)
|
||||
# 监听端口:默认 8080,可用环境变量 PORT 覆盖(端口冲突时可换端口)
|
||||
port = int(os.environ.get("PORT", 8080))
|
||||
print(f"[信息] 打开 http://127.0.0.1:{port} 查看「阅间」看板")
|
||||
app.run(host="0.0.0.0", port=port, debug=False)
|
||||
Reference in new issue
Block a user