Files
KCGL/inventory-backend/run.py
2026-02-04 13:30:07 +08:00

14 lines
525 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# inventory-backend/run.py
from app import create_app
# 【关键】这一行必须在最外层,不能放在 if __name__ ... 里面!
# Gunicorn 会导入这个变量
app = create_app()
if __name__ == '__main__':
# 这里是开发调试用的Docker/Gunicorn 不会执行这里
print("\n====== 当前所有注册路由 ======")
for rule in app.url_map.iter_rules():
print(f"{rule} -> {rule.endpoint}")
print("==============================\n")
app.run(host='0.0.0.0', port=8000, debug=True)