第一次提交

This commit is contained in:
2025-06-27 20:20:51 +08:00
commit 33f86752de
153 changed files with 6743 additions and 0 deletions

19
test/server/main.py Normal file
View File

@@ -0,0 +1,19 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from core.config import settings
from routes import example
app = FastAPI(title=settings.app_name)
# 允许所有域名跨域访问
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # ⚠️ 生产环境建议指定域名
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# 注册路由模块
app.include_router(example.router, prefix="/api")