Skip to content

Commit a143028

Browse files
committed
CORS enabled
1 parent cecd75b commit a143028

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fri/server/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pathlib import Path
66
import json
77
import subprocess
8+
from flask_cors import CORS, cross_origin
89

910
cur_path = os.path.dirname(os.path.abspath(__file__))
1011
concore_path = os.path.abspath(os.path.join(cur_path, '../../'))
@@ -13,6 +14,9 @@
1314
app = Flask(__name__)
1415
app.secret_key = "secret key"
1516

17+
cors = CORS(app)
18+
app.config['CORS_HEADERS'] = 'Content-Type'
19+
1620
# To upload multiple file. For example, /upload/test?apikey=xyz
1721
@app.route('/upload/<dir>', methods=['POST'])
1822
def upload(dir):

0 commit comments

Comments
 (0)