init
This commit is contained in:
15
new-planet-backend/app/middleware/cors.py
Normal file
15
new-planet-backend/app/middleware/cors.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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=["*"],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user