mirror of
https://github.com/Jerryplusy/AI-powered-switches.git
synced 2025-10-14 09:49:19 +00:00
19 lines
479 B
Python
19 lines
479 B
Python
from fastapi import FastAPI
|
|
from app.core.config import settings
|
|
from app.core.logger import logger
|
|
|
|
app = FastAPI(
|
|
title="交换机 API 平台",
|
|
description="自动化交换机配置和流量监控接口",
|
|
version="1.0.0"
|
|
)
|
|
|
|
@logger.catch
|
|
def start():
|
|
import uvicorn
|
|
logger.info(f"启动服务: http://localhost:{settings.port}/docs")
|
|
uvicorn.run("app.main:app", host="0.0.0.0", port=settings.port, reload=True)
|
|
|
|
if __name__ == "__main__":
|
|
start()
|