2026-01-09 17:32:54 -05:00
|
|
|
from fastapi import FastAPI
|
|
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
2026-01-03 13:19:49 -05:00
|
|
|
|
2026-01-09 17:32:54 -05:00
|
|
|
app = FastAPI()
|
|
|
|
|
app.add_middleware(
|
|
|
|
|
CORSMiddleware,
|
|
|
|
|
allow_origins=["*"],
|
|
|
|
|
allow_credentials=True,
|
|
|
|
|
allow_methods=["*"],
|
|
|
|
|
allow_headers=["*"],
|
|
|
|
|
)
|
2026-01-03 13:19:49 -05:00
|
|
|
|
|
|
|
|
|
2026-01-03 18:50:06 -05:00
|
|
|
@app.get("/hello")
|
2026-01-09 17:32:54 -05:00
|
|
|
@app.get("/api/hello")
|
2026-01-03 13:19:49 -05:00
|
|
|
def hello():
|
2026-01-09 17:32:54 -05:00
|
|
|
return {"message": "Hello from FastAPI"}
|