Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing healthcheck which was breaking due to jsonify error #18

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion workshop-1/app/like-service/service/mysfits_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
# sent to the service root will receive a healthy response.
@app.route("/")
def health_check_response():
return jsonify({"message" : "Nothing here, used for health check."})
flaskResponse = Response(response='{"message" : "Nothing here, used for health check. Try /mysfits instead."}', status=200)
flaskResponse.headers["Content-Type"] = "application/json"

return flaskResponse

# indicate that the provided mysfit should be marked as liked.

def process_like_request():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
# sent to the service root will receive a healthy response.
@app.route("/")
def healthCheckResponse():
return jsonify({"message" : "Nothing here, used for health check. Try /mysfits instead."})
flaskResponse = Response(response='{"message" : "Nothing here, used for health check. Try /mysfits instead."}', status=200)
flaskResponse.headers["Content-Type"] = "application/json"

return flaskResponse

# Retrive mysfits from DynamoDB based on provided querystring params, or all
# mysfits if no querystring is present.
Expand Down
5 changes: 4 additions & 1 deletion workshop-2/app/like-service/service/mysfits_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
# sent to the service root will receive a healthy response.
@app.route("/")
def health_check_response():
return jsonify({"message" : "Nothing here, used for health check."})
flaskResponse = Response(response='{"message" : "Nothing here, used for health check. Try /mysfits instead."}', status=200)
flaskResponse.headers["Content-Type"] = "application/json"

return flaskResponse
# indicate that the provided mysfit should be marked as liked.

def process_like_request():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
# sent to the service root will receive a healthy response.
@app.route("/")
def healthCheckResponse():
return jsonify({"message" : "Nothing here, used for health check. Try /mysfits instead."})
flaskResponse = Response(response='{"message" : "Nothing here, used for health check. Try /mysfits instead."}', status=200)
flaskResponse.headers["Content-Type"] = "application/json"

return flaskResponse

# Retrive mysfits from DynamoDB based on provided querystring params, or all
# mysfits if no querystring is present.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
# sent to the service root will receive a healthy response.
@app.route("/")
def healthCheckResponse():
return jsonify({"message" : "Nothing here, used for health check. Try /mysfits instead."})
flaskResponse = Response(response='{"message" : "Nothing here, used for health check. Try /mysfits instead."}', status=200)
flaskResponse.headers["Content-Type"] = "application/json"

return flaskResponse

# Retrive mysfits from DynamoDB based on provided querystring params, or all
# mysfits if no querystring is present.
Expand Down