first commit

This commit is contained in:
贺海国
2025-09-24 17:24:54 +08:00
parent 1eec5a35fc
commit 1dbc2330e0
15 changed files with 1522 additions and 0 deletions

27
app/main.py Normal file
View File

@@ -0,0 +1,27 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.routes.items import router as items_router
app = FastAPI(
title="FastAPI 示例应用",
description="一个使用uv管理的FastAPI示例应用",
version="0.1.0"
)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(items_router, prefix="/api/v1")
@app.get("/")
def read_root():
return {"message": "欢迎使用FastAPI示例应用"}
@app.get("/health")
def health_check():
return {"status": "healthy"}