fourcal-pms/backend/run.py

19 lines
497 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"""四算 PMS 后端入口。
python run.py # 默认 dev 档(config.dev.toml)
PMS_ENV=prod python run.py # 生产档(config.prod.toml)
"""
import os
import uvicorn
from app.config import settings
if __name__ == "__main__":
uvicorn.run(
"app.main:app",
host=os.environ.get("PMS_HOST", settings.server.host),
port=int(os.environ.get("PMS_PORT", settings.server.port)),
reload=os.environ.get("PMS_RELOAD", "1") == "1",
)