diff options
author | Mark Beierl <mark.beierl@dell.com> | 2017-06-05 18:00:38 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-06-05 18:00:38 +0000 |
commit | c8beb26dff69dde0b41685504718a5f2bb29b4cd (patch) | |
tree | 877dd8e949460881823c659a1f34b4597bb3da21 | |
parent | 73ae1dae45a61926588ad16866721a0cf03f0ff7 (diff) | |
parent | 5596aa1f65580af279b27569fbddac292cbcc2a6 (diff) |
Merge "Adding CORS Adds flask-cors module so that SwaggerUI can examine content from a different container JIRA: STORPERF-129"
-rwxr-xr-x | ci/verify.sh | 1 | ||||
-rw-r--r-- | docker/requirements.pip | 1 | ||||
-rw-r--r-- | rest_server.py | 2 |
3 files changed, 4 insertions, 0 deletions
diff --git a/ci/verify.sh b/ci/verify.sh index 84dc603..28d0886 100755 --- a/ci/verify.sh +++ b/ci/verify.sh @@ -23,6 +23,7 @@ pip install autoflake==0.6.6 pip install autopep8==1.2.2 pip install coverage==4.1 pip install flask==0.10 +pip install flask_cors==3.0.2 pip install flask-restful==0.3.5 pip install flask-restful-swagger==0.19 pip install flask-swagger==0.2.12 diff --git a/docker/requirements.pip b/docker/requirements.pip index b9336e8..d1724fb 100644 --- a/docker/requirements.pip +++ b/docker/requirements.pip @@ -8,6 +8,7 @@ python-keystoneclient==1.6.0 keystoneauth1==2.12.1 matplotlib==1.3.1 flask==0.10 +flask_cors==3.0.2 flask-restful==0.3.5 flask-restful-swagger==0.19 flask-swagger==0.2.12 diff --git a/rest_server.py b/rest_server.py index 574fc32..f6075f9 100644 --- a/rest_server.py +++ b/rest_server.py @@ -13,6 +13,7 @@ import os import sys from flask import abort, Flask, request, jsonify, send_from_directory +from flask_cors import CORS, cross_origin from flask_restful import Resource, Api, fields from flask_restful_swagger import swagger @@ -22,6 +23,7 @@ from storperf.storperf_master import StorPerfMaster app = Flask(__name__, static_url_path="") +CORS(app) api = swagger.docs(Api(app), apiVersion='1.0') storperf = StorPerfMaster() |