16 lines
372 B
Python
16 lines
372 B
Python
from fastapi.middleware.cors import CORSMiddleware
|
|
from fastapi import FastAPI
|
|
from app.core.config import settings
|
|
|
|
|
|
def setup_cors(app: FastAPI):
|
|
"""Настройка CORS"""
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.CORS_ORIGINS,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|