Skip to content

Commit

Permalink
fix(backend): changed Flask exposed port number so it works for Mac u…
Browse files Browse the repository at this point in the history
…sers
  • Loading branch information
Hanyuan Li committed May 13, 2022
1 parent c1f74ec commit bea65f8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ RUN pipenv lock -r > requirements.txt
RUN pip uninstall --yes pipenv
RUN pip install -r requirements.txt

EXPOSE 5000
EXPOSE 5001

CMD [ "python", "app.py" ]
6 changes: 3 additions & 3 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from werkzeug.exceptions import HTTPException

from auth.jwt import jwt, update_token
from routes.advent import advent
from routes.puzzle import puzzle
from routes.auth import auth

def handle_exception(error):
Expand Down Expand Up @@ -39,7 +39,7 @@ def create_app():

jwt.init_app(app)

app.register_blueprint(advent, url_prefix="/advent")
app.register_blueprint(puzzle, url_prefix="/advent")
app.register_blueprint(auth, url_prefix="/auth")

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

if __name__ == "__main__":
app = create_app()
app.run(host="0.0.0.0")
app.run(host="0.0.0.0", port=5001)
4 changes: 2 additions & 2 deletions backend/routes/advent.py → backend/routes/puzzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from advent.calendar.calendar import calendar

advent = Blueprint("advent", __name__)
puzzle = Blueprint("advent", __name__)

@advent.route("/description", methods=["GET"])
@puzzle.route("/description", methods=["GET"])
def description():
year = int(request.args.get("year"))
day = int(request.args.get("day"))
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
volumes:
- "./backend:/backend"
ports:
- "5000:5000"
- "5001:5001"
env_file: config/.flask.env

database:
Expand Down
Empty file.

0 comments on commit bea65f8

Please sign in to comment.