添加前后端

This commit is contained in:
小贺
2025-08-31 18:43:16 +08:00
parent 62bab70b08
commit 8de03156e1
28 changed files with 4161 additions and 0 deletions

20
backend/main.py Normal file
View File

@@ -0,0 +1,20 @@
from fastapi import FastAPI
import uvicorn
import random
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
@app.get("/hello/{name}")
async def say_hello(name: str):
return {"message": f"Hello {name}"}
@app.get("/api/random")
async def random_number():
return {"number": random.randint(1, 100)}