From 44d5d67b4041be6e45f9b17ffa69aa99b1b852b0 Mon Sep 17 00:00:00 2001 From: esensar Date: Fri, 18 May 2018 00:39:45 +0200 Subject: [PATCH] Add simple cors config --- app/__init__.py | 2 ++ requirements.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/app/__init__.py b/app/__init__.py index 8220f6d..65e1cbb 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -3,6 +3,7 @@ from flask_api import FlaskAPI from flask_sqlalchemy import SQLAlchemy from flask_bcrypt import Bcrypt from flasgger import Swagger +from flask_cors import CORS app = FlaskAPI(__name__, instance_relative_config=True) app.config.from_object('config') @@ -10,6 +11,7 @@ app.config.from_pyfile('config.py', silent=True) db = SQLAlchemy(app) bcrypt = Bcrypt(app) swagger = Swagger(app, template_file='swagger/template.yaml') +CORS(app) def setup_blueprints(app): diff --git a/requirements.txt b/requirements.txt index 93056ac..f47c021 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,6 +7,7 @@ flasgger==0.8.3 Flask==1.0.2 Flask-API==1.0 Flask-Bcrypt==0.7.1 +Flask-Cors==3.0.4 Flask-Migrate==2.1.1 Flask-MQTT==1.0.3 Flask-RESTful==0.3.6