implementação e liberação do CORS
This commit is contained in:
@@ -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("/")
|
||||
|
||||
Reference in New Issue
Block a user