Files
CICD_Learning/backend/main.py
2025-08-31 18:43:16 +08:00

21 lines
345 B
Python

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)}