Files
FastapiAdmin/backend/app/utils/banner.py
T
zhangtao 30118a4148 refactor: 优化服务启动流程和配置管理
重构服务启动流程,简化配置管理并移除不必要的UVICORN配置
优化控制台输出显示,增加服务启动和关闭的友好提示
移除.env文件和生产环境配置中的冗余参数
在banner中增加当前运行环境显示
2025-11-20 02:09:52 +08:00

10 lines
326 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.
from app.config.path_conf import BANNER_FILE
def worship(env: str) -> str | None:
"""
获取项目启动Banner(优先读取 banner.txt
"""
if BANNER_FILE.exists():
banner = BANNER_FILE.read_text(encoding='utf-8')
banner = banner + f"🚀 当前运行环境: {env}\n"
return banner