Add simple cors config
parent
a006a6ac5f
commit
44d5d67b40
|
@ -3,6 +3,7 @@ from flask_api import FlaskAPI
|
||||||
from flask_sqlalchemy import SQLAlchemy
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
from flask_bcrypt import Bcrypt
|
from flask_bcrypt import Bcrypt
|
||||||
from flasgger import Swagger
|
from flasgger import Swagger
|
||||||
|
from flask_cors import CORS
|
||||||
|
|
||||||
app = FlaskAPI(__name__, instance_relative_config=True)
|
app = FlaskAPI(__name__, instance_relative_config=True)
|
||||||
app.config.from_object('config')
|
app.config.from_object('config')
|
||||||
|
@ -10,6 +11,7 @@ app.config.from_pyfile('config.py', silent=True)
|
||||||
db = SQLAlchemy(app)
|
db = SQLAlchemy(app)
|
||||||
bcrypt = Bcrypt(app)
|
bcrypt = Bcrypt(app)
|
||||||
swagger = Swagger(app, template_file='swagger/template.yaml')
|
swagger = Swagger(app, template_file='swagger/template.yaml')
|
||||||
|
CORS(app)
|
||||||
|
|
||||||
|
|
||||||
def setup_blueprints(app):
|
def setup_blueprints(app):
|
||||||
|
|
|
@ -7,6 +7,7 @@ flasgger==0.8.3
|
||||||
Flask==1.0.2
|
Flask==1.0.2
|
||||||
Flask-API==1.0
|
Flask-API==1.0
|
||||||
Flask-Bcrypt==0.7.1
|
Flask-Bcrypt==0.7.1
|
||||||
|
Flask-Cors==3.0.4
|
||||||
Flask-Migrate==2.1.1
|
Flask-Migrate==2.1.1
|
||||||
Flask-MQTT==1.0.3
|
Flask-MQTT==1.0.3
|
||||||
Flask-RESTful==0.3.6
|
Flask-RESTful==0.3.6
|
||||||
|
|
Loading…
Reference in New Issue