Skip to content

Commit a2bf5ed

Browse files
committed
Fixed to work with local frontend
1 parent 2ffdc3f commit a2bf5ed

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

app/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
from flask_cors import CORS
12
from flask import Flask
3+
import os
24
from .routes.task_routes import bp as task_bp
35
from .routes.goal_routes import bp as goal_bp
46
from .db import db, migrate
57
from .models import task, goal
6-
import os
8+
79

810
def create_app(config=None):
911
app = Flask(__name__)
10-
12+
CORS(app)
1113
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
1214
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('SQLALCHEMY_DATABASE_URI')
1315

app/routes/task_routes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
bp = Blueprint("tasks_bp", __name__, url_prefix="/tasks")
1111

12+
1213
@bp.post("/", strict_slashes=False)
1314
def create_task():
1415
return create_class_instance(Task, request, ["title", "description"])

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ certifi==2024.8.30
44
charset-normalizer==3.3.2
55
click==8.1.7
66
Flask==3.0.2
7+
Flask-Cors==5.0.0
78
Flask-Migrate==4.0.5
89
Flask-SQLAlchemy==3.1.1
910
greenlet==3.0.3
@@ -19,9 +20,8 @@ pluggy==1.4.0
1920
psycopg2-binary==2.9.9
2021
pytest==8.0.0
2122
python-dotenv==1.0.1
22-
requests==2.32.3
23+
requests==2.31.0
2324
SQLAlchemy==2.0.25
2425
typing_extensions==4.9.0
25-
urllib3<2.0
26-
# urllib3==2.2.3
26+
urllib3==2.0.7
2727
Werkzeug==3.0.1

0 commit comments

Comments
 (0)