支持自定义端口

This commit is contained in:
2026-07-03 19:33:16 +08:00
parent 83b55c0c72
commit 8c05311628
7 changed files with 28 additions and 4 deletions
+3 -2
View File
@@ -1,7 +1,8 @@
from app import app
from config import Settings
if __name__ == "__main__":
import uvicorn
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
settings = Settings.from_env()
uvicorn.run("main:app", host="0.0.0.0", port=settings.port, reload=True)