From c11d34f21ed0fea5ffee123fc9061da5fd13ebae Mon Sep 17 00:00:00 2001 From: Yves Gugger Date: Tue, 9 Dec 2025 08:21:58 +0100 Subject: [PATCH] Fix CORS: Load .env file in main.py - Added dotenv load_dotenv() at startup to ensure ALLOWED_ORIGINS env var is loaded - This fixes CORS errors when accessing from https://pounce.ch --- backend/app/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/app/main.py b/backend/app/main.py index eabc30c..5c1da28 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -2,6 +2,10 @@ import logging import os from contextlib import asynccontextmanager +from dotenv import load_dotenv + +# Load .env file before anything else +load_dotenv() from fastapi import FastAPI, Request, status from fastapi.middleware.cors import CORSMiddleware