diff --git a/services/feedback-service/app.py b/services/feedback-service/app.py index 4888e7e8..2e85b139 100644 --- a/services/feedback-service/app.py +++ b/services/feedback-service/app.py @@ -6,6 +6,7 @@ from cloudevents.conversion import to_binary from cloudevents.http import CloudEvent from flask import Flask, request +from flask_cors import CORS, cross_origin K_SINK = os.environ.get("K_SINK") SOURCE_DECLARATION = os.environ.get("SOURCE_DECLARATION") @@ -28,9 +29,12 @@ def handler(signal, frame): signal.signal(signal.SIGTERM, handler) app = Flask(__name__) +cors = CORS(app) +app.config['CORS_HEADERS'] = 'Content-Type' @app.route("/", methods=["POST"]) +@cross_origin() def receive_feedback(): # request body looks like this: # { diff --git a/services/feedback-service/requirements.txt b/services/feedback-service/requirements.txt index 7ea6694a..6b39a6f4 100644 --- a/services/feedback-service/requirements.txt +++ b/services/feedback-service/requirements.txt @@ -2,3 +2,4 @@ flask==2.3.2 cloudevents==1.10.0 requests==2.31.0 gunicorn==21.2.0 +flask-cors==4.0.0