Allow seting CORS origin

This commit is contained in:
Craig Quiter
2024-08-18 14:17:26 -07:00
parent 446b2a334a
commit d2f10d50bf
8 changed files with 45 additions and 14 deletions

View File

@@ -51,6 +51,7 @@ from config import (
IMAGE_SIZE,
IMAGE_STEPS,
AppConfig,
CORS_ALLOW_ORIGIN,
)
log = logging.getLogger(__name__)
@@ -62,7 +63,7 @@ IMAGE_CACHE_DIR.mkdir(parents=True, exist_ok=True)
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_origins=CORS_ALLOW_ORIGIN,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],