27 lines
553 B
Python
27 lines
553 B
Python
"""AI Balance Monitor 入口:python main.py"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import logging
|
|
|
|
import uvicorn
|
|
|
|
from app.api import create_app
|
|
from app.config import load_config
|
|
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
|
|
)
|
|
|
|
|
|
def main() -> None:
|
|
cfg = load_config()
|
|
app = create_app(cfg)
|
|
print(f"AI Balance Monitor 已启动: http://127.0.0.1:{cfg.port}")
|
|
uvicorn.run(app, host="0.0.0.0", port=cfg.port, log_level="warning")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|