Skip to content

Commit bea65f8

Browse files
author
Hanyuan Li
committed
fix(backend): changed Flask exposed port number so it works for Mac users
1 parent c1f74ec commit bea65f8

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ RUN pipenv lock -r > requirements.txt
1515
RUN pip uninstall --yes pipenv
1616
RUN pip install -r requirements.txt
1717

18-
EXPOSE 5000
18+
EXPOSE 5001
1919

2020
CMD [ "python", "app.py" ]

backend/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from werkzeug.exceptions import HTTPException
77

88
from auth.jwt import jwt, update_token
9-
from routes.advent import advent
9+
from routes.puzzle import puzzle
1010
from routes.auth import auth
1111

1212
def handle_exception(error):
@@ -39,7 +39,7 @@ def create_app():
3939

4040
jwt.init_app(app)
4141

42-
app.register_blueprint(advent, url_prefix="/advent")
42+
app.register_blueprint(puzzle, url_prefix="/advent")
4343
app.register_blueprint(auth, url_prefix="/auth")
4444

4545
app.register_error_handler(HTTPException, handle_exception)
@@ -48,4 +48,4 @@ def create_app():
4848

4949
if __name__ == "__main__":
5050
app = create_app()
51-
app.run(host="0.0.0.0")
51+
app.run(host="0.0.0.0", port=5001)

backend/routes/advent.py renamed to backend/routes/puzzle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
from advent.calendar.calendar import calendar
44

5-
advent = Blueprint("advent", __name__)
5+
puzzle = Blueprint("advent", __name__)
66

7-
@advent.route("/description", methods=["GET"])
7+
@puzzle.route("/description", methods=["GET"])
88
def description():
99
year = int(request.args.get("year"))
1010
day = int(request.args.get("day"))
File renamed without changes.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
volumes:
1010
- "./backend:/backend"
1111
ports:
12-
- "5000:5000"
12+
- "5001:5001"
1313
env_file: config/.flask.env
1414

1515
database:

frontend/src/components/ProtectedRoute.tsx

Whitespace-only changes.

0 commit comments

Comments
 (0)