From c9bb794871d26ab92437b51fbed735fa33ad40a6 Mon Sep 17 00:00:00 2001 From: Justin Hsieh <41461549+justin-hsieh@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:10:15 -0700 Subject: [PATCH 1/3] Update app.py --- app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 17f8556..e65f0ed 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,7 @@ # Third-party imports from flask import Flask, jsonify, request import json +from flask_cors import CORS, cross_origin # from decouple import config from fantasy_app.functions import get_current_matchups, current_week, get_most_position_points, order_positions_by_points from fantasy_app.contest_list import contests @@ -8,7 +9,8 @@ # app.config['SQLALCHEMY_DATABASE_URI'] = config('DATABASE_URL') app = Flask(__name__) - +allowed_origins = ["http://localhost:3000/"] +CORS(app, supports_credentials=True, origins=allowed_origins) # stop tracking modifications # app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False From f715259cb55229691cccb6c33c3d59417f79f045 Mon Sep 17 00:00:00 2001 From: Justin Hsieh <41461549+justin-hsieh@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:16:36 -0700 Subject: [PATCH 2/3] Update requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index e69d333..b97fdea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,6 +11,7 @@ dill==0.3.5.1 docopt==0.6.2 espn-api==0.21.0 Flask==2.2.2 +Flask-Cors==4.0.0 gunicorn==20.1.0 idna==3.3 importlib-metadata==4.12.0 From 105946a80e64475b8fa6535ce7f3234e489f9810 Mon Sep 17 00:00:00 2001 From: Justin Hsieh <41461549+justin-hsieh@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:35:50 -0700 Subject: [PATCH 3/3] Update app.py --- app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.py b/app.py index e65f0ed..51b219c 100644 --- a/app.py +++ b/app.py @@ -9,8 +9,7 @@ # app.config['SQLALCHEMY_DATABASE_URI'] = config('DATABASE_URL') app = Flask(__name__) -allowed_origins = ["http://localhost:3000/"] -CORS(app, supports_credentials=True, origins=allowed_origins) +CORS(app, supports_credentials=True) # stop tracking modifications # app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False