Files
print-calculator/backend/main.py
2025-05-19 15:50:55 +02:00

17 lines
395 B
Python

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # oppure ["http://localhost:4200"] se vuoi essere più restrittivo
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/api/hello")
def hello():
return {"message": "Hello from Python API"}