implementação e liberação do CORS

This commit is contained in:
2026-05-28 13:46:51 -05:00
parent 0a8a3d271d
commit d51155dd86
2 changed files with 53 additions and 17 deletions

View File

@@ -1,4 +1,5 @@
from fastapi import FastAPI, Depends
from fastapi.middleware.cors import CORSMiddleware
from app.core.security import get_current_user, UserAuth
from app.core.config import settings
from app.api.v1.api import api_router
@@ -12,6 +13,14 @@ app = FastAPI(
openapi_url=f"{settings.API_V1_STR}/openapi.json"
)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(api_router, prefix=settings.API_V1_STR)
@app.get("/")