fix(CORS) CORS ERROR on Heroku

The Heroku deployment experienced the following error.

```No 'Access-Control-Allow-Origin' header is present on the requested resource. ```
This commit is contained in:
walkews 2017-07-12 06:33:12 -05:00
parent 43ec7e5ca8
commit e0c9aaa5ce

View file

@ -14,6 +14,7 @@ from collections import Counter
from flask import Flask
from flask import request, render_template, make_response, jsonify, Blueprint, url_for
from flask_restplus import Resource, Api, fields, reqparse
from flask_cors import CORS, cross_origin
import settings
import etl
import palettes as pal
@ -22,6 +23,7 @@ from iplotter import C3Plotter
c3 = C3Plotter()
app = Flask(__name__)
CORS(app)
api_blueprint = Blueprint('api', __name__, url_prefix='/api')
api = Api(api_blueprint, title='pyDataVizday api',
description='This api is used for the pyDataVizDay visualization',