Enabled CORS on /api routes

This commit is contained in:
Joel Collins 2019-01-18 16:49:21 +00:00
parent ba4599d4a3
commit 8170726430

View file

@ -18,6 +18,8 @@ from flask import (
from flask.views import MethodView
from werkzeug.exceptions import default_exceptions
from flask_cors import CORS
from openflexure_microscope.api.utilities import list_routes
from openflexure_microscope import Microscope, config
@ -47,6 +49,8 @@ def uri(suffix, api_version, base=None):
app = Flask(__name__)
app.url_map.strict_slashes = False
CORS(app, resources=r'/api/*')
# Make errors more API friendly