From a143028c86f42ee677b5b991a1a37677fb6c57d1 Mon Sep 17 00:00:00 2001 From: Rahul Date: Fri, 10 Feb 2023 16:19:53 +0530 Subject: [PATCH] CORS enabled --- fri/server/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fri/server/main.py b/fri/server/main.py index e546761..203a94d 100644 --- a/fri/server/main.py +++ b/fri/server/main.py @@ -5,6 +5,7 @@ from pathlib import Path import json import subprocess +from flask_cors import CORS, cross_origin cur_path = os.path.dirname(os.path.abspath(__file__)) concore_path = os.path.abspath(os.path.join(cur_path, '../../')) @@ -13,6 +14,9 @@ app = Flask(__name__) app.secret_key = "secret key" +cors = CORS(app) +app.config['CORS_HEADERS'] = 'Content-Type' + # To upload multiple file. For example, /upload/test?apikey=xyz @app.route('/upload/', methods=['POST']) def upload(dir):