From 55ef348fbe313caf493e70880c94bd77f1387ac8 Mon Sep 17 00:00:00 2001 From: jdhayhurst Date: Fri, 11 Sep 2020 15:03:04 +0100 Subject: [PATCH] add cors --- requirements.txt | 1 + sumstats/server/app.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/requirements.txt b/requirements.txt index 78b336d..ab9ee21 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,6 +10,7 @@ dnspython==1.16.0 docutils==0.15.2 eventlet==0.25.1 Flask==1.1.1 +Flask-Cors==3.0.9 greenlet==0.4.15 gunicorn==19.9.0 h5py==2.8.0 diff --git a/sumstats/server/app.py b/sumstats/server/app.py index 5a89079..f936609 100644 --- a/sumstats/server/app.py +++ b/sumstats/server/app.py @@ -3,6 +3,7 @@ import logging from logging import config from flask import Flask, make_response, Response +from flask_cors import CORS from sumstats.utils import register_logger from sumstats.utils.properties_handler import properties from sumstats.server.error_classes import * @@ -16,6 +17,7 @@ app = Flask(__name__) app.url_map.strict_slashes = False +cors = CORS(app) @api.errorhandler(APIException)