Add api dependencies

This commit is contained in:
2025-09-24 17:48:38 +02:00
parent b0513c4662
commit 98d4f308ba
5 changed files with 81 additions and 11 deletions

12
main.py
View File

@@ -8,7 +8,17 @@ from config import config
def create_app():
app = Flask(__name__)
CORS(app)
origins = [
"http://localhost:3000",
"http://127.0.0.1:3000"
]
CORS(app, supports_credentials=True, origins=origins)
app.config.update(
SESSION_COOKIE_SAMESITE="None", # necessary for cross-site cookies
SESSION_COOKIE_SECURE=False # True in prod (HTTPS)
)
env = os.environ.get('FLASK_ENV', 'default')
app.config.from_object(config[env])